<?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 do you combine data from two source types based on common values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381475#M111573</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=???  host=??? (sourcetype=A OR sourcetype=B) 
 | eval commonfield=coalesce(aaa,bbb)
 | rex field=_raw "ClientId=(?&amp;lt;cID&amp;gt;\d+)"
 | stats values(cID) as ID values(Duration) as Duration by commonfield
 | eval Duration = round(Duration,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Sep 2018 20:42:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-09-13T20:42:01Z</dc:date>
    <item>
      <title>How do you combine data from two source types based on common values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381474#M111572</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I have a question regarding source types. I have 2 source types "A" and "B". "A" has a field called "aaa" and "B" has field call "bbb". These two fields share the same value ( example: aaa=123, bbb=123) but the field name is different.  I want to combine the two source types based on the fields with the same value(the value will change dynamically so I can't hardcode it) and extract data from both source types. &lt;/P&gt;

&lt;P&gt;Is it possible and if it is, how would I approach this? &lt;/P&gt;

&lt;P&gt;I tried something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=???  host=??? (sourcetype=A OR sourcetype=B) 
| rename aaa as bbb
| rex field=_raw "ClientId=(?\d+)"
| stats values(cID) as ID by bbb
| eval Duration = round(Duration,3)
| tab
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 19:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381474#M111572</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2018-09-13T19:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you combine data from two source types based on common values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381475#M111573</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=???  host=??? (sourcetype=A OR sourcetype=B) 
 | eval commonfield=coalesce(aaa,bbb)
 | rex field=_raw "ClientId=(?&amp;lt;cID&amp;gt;\d+)"
 | stats values(cID) as ID values(Duration) as Duration by commonfield
 | eval Duration = round(Duration,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381475#M111573</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-09-13T20:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you combine data from two source types based on common values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381476#M111574</link>
      <description>&lt;P&gt;It worked. Thank you for the quick response. &lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 20:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-combine-data-from-two-source-types-based-on-common/m-p/381476#M111574</guid>
      <dc:creator>dminev1</dc:creator>
      <dc:date>2018-09-13T20:56:39Z</dc:date>
    </item>
  </channel>
</rss>

