<?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 do you correlate one field between two sources, and then if they match, find value from another field from the second source type? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400956#M116116</link>
    <description>&lt;P&gt;I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype_a` and`sourcetype_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where one field &lt;CODE&gt;message_ID&lt;/CODE&gt; exists in both source types.&lt;/P&gt;

&lt;P&gt;I want to loop through each &lt;CODE&gt;message_ID&lt;/CODE&gt; in &lt;CODE&gt;sourcetype_a&lt;/CODE&gt; and look for it in &lt;CODE&gt;sourcetype_b&lt;/CODE&gt;, then if it finds it, look for the value of field: &lt;CODE&gt;result&lt;/CODE&gt; in sourcetype_b, and print out all where &lt;CODE&gt;result=success&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Can anyone help explain how this can be achieved, please?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2019 13:49:27 GMT</pubDate>
    <dc:creator>luke222010</dc:creator>
    <dc:date>2019-01-09T13:49:27Z</dc:date>
    <item>
      <title>How do you correlate one field between two sources, and then if they match, find value from another field from the second source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400956#M116116</link>
      <description>&lt;P&gt;I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype_a` and`sourcetype_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where one field &lt;CODE&gt;message_ID&lt;/CODE&gt; exists in both source types.&lt;/P&gt;

&lt;P&gt;I want to loop through each &lt;CODE&gt;message_ID&lt;/CODE&gt; in &lt;CODE&gt;sourcetype_a&lt;/CODE&gt; and look for it in &lt;CODE&gt;sourcetype_b&lt;/CODE&gt;, then if it finds it, look for the value of field: &lt;CODE&gt;result&lt;/CODE&gt; in sourcetype_b, and print out all where &lt;CODE&gt;result=success&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Can anyone help explain how this can be achieved, please?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 13:49:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400956#M116116</guid>
      <dc:creator>luke222010</dc:creator>
      <dc:date>2019-01-09T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correlate one field between two sources, and then if they match, find value from another field from the second source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400957#M116117</link>
      <description>&lt;P&gt;@luke222010,&lt;/P&gt;

&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(sourcetype="sourcetype_a" OR sourcetype="sourcetype_b")
|eventstats dc(sourcetype) as c by message_ID |where c&amp;gt; 1 AND result="success"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jan 2019 14:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400957#M116117</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-09T14:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correlate one field between two sources, and then if they match, find value from another field from the second source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400958#M116118</link>
      <description>&lt;P&gt;Hi  luke222010,&lt;BR /&gt;
try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index sourcetype=sourcetype_b [ search index=my_index sourcetype=sourcetype_a | fields message_ID ] result=access
| table _time message_ID result
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in other words you use the message_IDs resulting from subsearch to filter the main search, then you can display results in a table (I displayed only _time, message_ID and result fields but you can display also other fields from the main search).&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400958#M116118</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T22:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you correlate one field between two sources, and then if they match, find value from another field from the second source type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400959#M116119</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140770"&gt;@luke222010&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;You can try below query : &lt;/P&gt;

&lt;P&gt;sourcetype="sourcetype_a"&lt;BR /&gt;
|table msgID&lt;BR /&gt;
|appendpipe &lt;BR /&gt;
   [|search sourcetype="sourcetype_b" result="success" |table result,msgID ]&lt;BR /&gt;
|stats values(result) as result count by msgID&lt;BR /&gt;
| where count=2&lt;BR /&gt;
| table result&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Bhavik&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:45:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-correlate-one-field-between-two-sources-and-then-if/m-p/400959#M116119</guid>
      <dc:creator>bhavikbhalodia</dc:creator>
      <dc:date>2020-09-29T22:45:13Z</dc:date>
    </item>
  </channel>
</rss>

