<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to correlate data between two different sourcetypes when one is in JSON format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-correlate-data-between-two-different-sourcetypes-when-one/m-p/362996#M66154</link>
    <description>&lt;P&gt;This probably isn't &lt;EM&gt;the&lt;/EM&gt; answer, but hopefully you can run with it. &lt;/P&gt;

&lt;P&gt;Something along the lines of.. &lt;/P&gt;

&lt;P&gt;sourcetype=sourcetypeA &lt;BR /&gt;
| stats values(*) as * by publishId &lt;BR /&gt;
| join publishId type=left &lt;BR /&gt;
    [| search sourcetypeB &lt;BR /&gt;
    | spath &lt;BR /&gt;
    | (Do the field manipulation/extraction you want here, might have to use rex, eval, foreach or a combination of the 3) &lt;BR /&gt;
    | table fieldyoucareabout, publishId&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 02:59:10 GMT</pubDate>
    <dc:creator>David_Naylor</dc:creator>
    <dc:date>2018-04-26T02:59:10Z</dc:date>
    <item>
      <title>How to correlate data between two different sourcetypes when one is in JSON format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-correlate-data-between-two-different-sourcetypes-when-one/m-p/362995#M66153</link>
      <description>&lt;P&gt;I have one index and two sourcetypes.  I want to be able to count the actions from sourcetypeA and correlate the data from sourcetypeB.   SourcetypeB however is in JSON format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**sourcetypeA:**
  accountId: 12345678       
       **action:** Enter        
       assetId: 7a8b9c      
       dateTime: 2018-04-21T20:32:52.295348Z        
       deviceID: abcdefgh       
       **publishId:** 63600U        
       **tile:** Tile1          

**sourcetypeB:**             
    dateTime: 2018-04-21T19:44:41.3524516Z      
       **publishId**: 63600U        
       published: { [-] 
         Background: {  [+] 
         }      
         Condition: {   [+] 
         }      
         EditBy: charlie        
         EditTime: 2018-04-15T19:43:58.1671071Z     
         Id: 6      
         Info: {    [+] 
         }      
         PublishBy: charlie     
         PublishTime: 2018-04-15T19:44:41.3524516Z      
         ScheduleTime: 2018-04-15T19:50:00Z     
         Template: {    [+] 
         }      
         Tiles: [   [-] 
           {    [+] 
           }    
           {    [+] 
           }    
           {    [-] 
             Condition: {   [+] 
             }      
             Id: 2      
             **Name:** Tile1        
             **Subscribed:** {  [-] 
               Images: [    [+] 
               ]        
               Live: {  [+] 
               }        
               Text: [  [-] 
                 Tile1Text  

               ]        
               **TileTypeIndicator**: category      
               }        
             **Unsubscribed**: {    [-] 
               Images: [    [+]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to join (don't know if that is the right word used in SPL?) on "publishId" between the two sourcetypes.&lt;BR /&gt;
Then count the number of "tiles" from sourcetypeA while referencing the related information from sourcetypeB?&lt;BR /&gt;
i.e.  Tile1  is Tile1Text,      Tile2 is Tile2Text,       Tile3 is Tile3Text, etc.&lt;/P&gt;

&lt;P&gt;sourceytypeA has the data for how many times "tile" is logged.  i.e.  Tile1&lt;BR /&gt;
sourcetypeB has the information of what Tile1 is referenced to.   i.e. Tile1Text&lt;BR /&gt;
Then sort between subscribed and unsubscribed.&lt;/P&gt;

&lt;P&gt;| rename published.Tiles{}.Name AS Name, published.Tiles{}.Subscribed.Text{} as Text&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 21:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-correlate-data-between-two-different-sourcetypes-when-one/m-p/362995#M66153</guid>
      <dc:creator>dwong2</dc:creator>
      <dc:date>2018-04-25T21:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data between two different sourcetypes when one is in JSON format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-correlate-data-between-two-different-sourcetypes-when-one/m-p/362996#M66154</link>
      <description>&lt;P&gt;This probably isn't &lt;EM&gt;the&lt;/EM&gt; answer, but hopefully you can run with it. &lt;/P&gt;

&lt;P&gt;Something along the lines of.. &lt;/P&gt;

&lt;P&gt;sourcetype=sourcetypeA &lt;BR /&gt;
| stats values(*) as * by publishId &lt;BR /&gt;
| join publishId type=left &lt;BR /&gt;
    [| search sourcetypeB &lt;BR /&gt;
    | spath &lt;BR /&gt;
    | (Do the field manipulation/extraction you want here, might have to use rex, eval, foreach or a combination of the 3) &lt;BR /&gt;
    | table fieldyoucareabout, publishId&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 02:59:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-correlate-data-between-two-different-sourcetypes-when-one/m-p/362996#M66154</guid>
      <dc:creator>David_Naylor</dc:creator>
      <dc:date>2018-04-26T02:59:10Z</dc:date>
    </item>
  </channel>
</rss>

