<?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 How to correlate data from different sources in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688990#M234830</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how to correlate data using different sources.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source A contains:&amp;nbsp;&lt;/P&gt;&lt;P&gt;User ID = 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source B contains&lt;/P&gt;&lt;P&gt;User ID =123&amp;nbsp;&lt;/P&gt;&lt;P&gt;User email = &lt;A href="mailto:user@user" target="_blank" rel="noopener"&gt;user@user&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find the user related to the UserID 123 (which comes up after my search). I want to do this by getting the User emal from Source B.&amp;nbsp; My search runs in Source A since there are some fields I need from there.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2024 12:32:07 GMT</pubDate>
    <dc:creator>vstan</dc:creator>
    <dc:date>2024-05-29T12:32:07Z</dc:date>
    <item>
      <title>How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688990#M234830</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how to correlate data using different sources.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source A contains:&amp;nbsp;&lt;/P&gt;&lt;P&gt;User ID = 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source B contains&lt;/P&gt;&lt;P&gt;User ID =123&amp;nbsp;&lt;/P&gt;&lt;P&gt;User email = &lt;A href="mailto:user@user" target="_blank" rel="noopener"&gt;user@user&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find the user related to the UserID 123 (which comes up after my search). I want to do this by getting the User emal from Source B.&amp;nbsp; My search runs in Source A since there are some fields I need from there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 12:32:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688990#M234830</guid>
      <dc:creator>vstan</dc:creator>
      <dc:date>2024-05-29T12:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688991#M234831</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268456"&gt;@vstan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you have to use stats command BY the correlation key, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexA OR index=indexB
| stats 
     values(field1) AS field1
     values(field2) AS field2
     values(field3) AS field3
     values(User_email) As User_email
     BY User_ID&lt;/LI-CODE&gt;&lt;P&gt;you can add all the fields you need in the stats command.&lt;/P&gt;&lt;P&gt;Anyway, don't use join command!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 12:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688991#M234831</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-29T12:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688994#M234832</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can't seem to make it work. I'll try to explain more detailed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two sources (sourcetypes basically).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source A&amp;nbsp;&lt;/P&gt;
&lt;P&gt;User ID&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total bytes send&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source B&amp;nbsp;&lt;/P&gt;
&lt;P&gt;User ID&lt;/P&gt;
&lt;P&gt;User Email address&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to calculate the total bytes send per User ID (For this I need Source A). Now Have I done this and the results generate an ID with the amount of Bytes send for each user.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next step for me is to put the User Email Address next to the User ID.&amp;nbsp; This value is only known in Source B. So I need to correlate them together so that I can tell Splunk hey look up this UserID and give me User Email Address back in a table next to it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I currently have the following:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="ABC"
source="SourceA" OR source="SourceB"
| eval Total_Bytes_Size=TOTAL_ATTACHMENT_SIZE_SEGMENT
| eval user=User
| dedup User
| where NOT Total_Bytes_Size="TOTAL_ATTACHMENT_SIZE_SEGMENT"
| where NOT Total_Bytes_Size="0MB"
| table User,  Total_Bytes_Size
| sort - Total_Bytes_Size&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This gives me a table with The UserID and the total Bytes size sent. Now I only need to add a row with the corresponding EMAIL_ADDRESS from source B.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this clears it up a bit.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 16:54:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688994#M234832</guid>
      <dc:creator>vstan</dc:creator>
      <dc:date>2024-05-29T16:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688995#M234833</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268456"&gt;@vstan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;are you sure that you don't need to sum the bytes?&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC"
(sourcetype="SourceA" OR sourcetype="SourceB")
| eval User=coalesce(user,User)
| stats 
     sum (TOTAL_ATTACHMENT_SIZE_SEGMENT) AS Total_Bytes_Size 
     values(EMAIL_ADDRESS) AS EMAIL_ADDRESS 
     BY User
| sort - Total_Bytes_Size&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 13:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688995#M234833</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-29T13:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688998#M234834</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data is already 'summed' -&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how it is stored.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TOTAL_ATTACHMENT_SIZE_SEGMENT 5-25MB&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to run the query you provided it gives me an error:&amp;nbsp;&lt;SPAN&gt;Error in 'stats' command: The argument '(TOTAL_ATTACHMENT_SIZE_SEGMENT)' is invalid.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 16:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/688998#M234834</guid>
      <dc:creator>vstan</dc:creator>
      <dc:date>2024-05-29T16:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689000#M234836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268456"&gt;@vstan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC"
(sourcetype="SourceA" OR sourcetype="SourceB")
| eval User=coalesce(user,User)
| stats 
     values(TOTAL_ATTACHMENT_SIZE_SEGMENT) AS Total_Bytes_Size 
     values(EMAIL_ADDRESS) AS EMAIL_ADDRESS 
     BY User
| sort - Total_Bytes_Size&lt;/LI-CODE&gt;&lt;P&gt;the error was for the space after sum.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 13:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689000#M234836</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-29T13:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689003#M234838</link>
      <description>&lt;P class="lia-align-left"&gt;Unfortunately I get 0 results...&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 14:03:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689003#M234838</guid>
      <dc:creator>vstan</dc:creator>
      <dc:date>2024-05-29T14:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689055#M234848</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268456"&gt;@vstan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;check if in all events you have the User field (fields are case sensitive!), if not add in the coalesce command all the fields containing the User values to use as correlation key.&lt;/P&gt;&lt;P&gt;Then check the exact field name of&amp;nbsp;&lt;SPAN&gt;TOTAL_ATTACHMENT_SIZE_SEGMENT and&amp;nbsp;EMAIL_ADDRESS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 06:03:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689055#M234848</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-05-30T06:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to correlate data from different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689057#M234849</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used your solution and it worked. I now only have to fix the bytes as they don't show up, but I will try to solve&amp;nbsp; it myself :D. Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 06:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-correlate-data-from-different-sources/m-p/689057#M234849</guid>
      <dc:creator>vstan</dc:creator>
      <dc:date>2024-05-30T06:20:06Z</dc:date>
    </item>
  </channel>
</rss>

