<?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 combine data from 2 source types? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241731#M188926</link>
    <description>&lt;P&gt;Are the locomotive #'s stored as two separate fields (one for each sourcetype?) or are they stored under the same name?&lt;/P&gt;

&lt;P&gt;If they're different..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=src1 OR sourcetype=src2 | where locomotive1=locomotive2 | table locomotive1, col2, col3, districtname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If they're the same..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=src1 OR sourcetype=src2 | transaction locomotive | table locomotive, col2, col3, districtname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Jan 2016 18:27:54 GMT</pubDate>
    <dc:creator>jluo_splunk</dc:creator>
    <dc:date>2016-01-22T18:27:54Z</dc:date>
    <item>
      <title>How  to combine data from 2 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241730#M188925</link>
      <description>&lt;P&gt;All,&lt;/P&gt;

&lt;P&gt;I have 2 source types , one being XML and other being a trace log file events. I have a requirement to combine values from both. Sourcetype 1 : ITCM (trace log files) and for a given Locomotive number, go and find the events from Second source type and retrieve some info (example district name) and append to the column of the first . Basically I am displaying a table  to show all the necessary fields from the first source type and just append a column with values from the second source type (based on the matching condition - locomotive number).&lt;/P&gt;

&lt;P&gt;I was able to combine both the source types but hadn't been successful in appending the column values from the second source, basically I tried eval (if condition match), append cols etc.&lt;/P&gt;

&lt;P&gt;Issues with eval(if condition match) - I can see the eval condition matches only for the events coming from second source type and doesn't equate to the events on first source type and output as below&lt;/P&gt;

&lt;P&gt;Row #1  displays values from sourcetype1 col1(value=locomotive number), col2value, col3value,col4 =blank (districtname) &lt;BR /&gt;
Row #2  displays values from sourcetype2 (col1value=locomotive number), blank (col2value), blank (col3value),districtname (col4value)&lt;/P&gt;

&lt;P&gt;Bascially I wanted to get a result that shows one row for each event as below &lt;BR /&gt;
col1(value=locomotive number), col2value, col3value, ,districtname&lt;/P&gt;

&lt;P&gt;Thoughts/Suggestions please&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mathan J&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 16:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241730#M188925</guid>
      <dc:creator>Mathanjey</dc:creator>
      <dc:date>2016-01-22T16:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How  to combine data from 2 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241731#M188926</link>
      <description>&lt;P&gt;Are the locomotive #'s stored as two separate fields (one for each sourcetype?) or are they stored under the same name?&lt;/P&gt;

&lt;P&gt;If they're different..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=src1 OR sourcetype=src2 | where locomotive1=locomotive2 | table locomotive1, col2, col3, districtname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If they're the same..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=src1 OR sourcetype=src2 | transaction locomotive | table locomotive, col2, col3, districtname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Jan 2016 18:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241731#M188926</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2016-01-22T18:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How  to combine data from 2 source types?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241732#M188927</link>
      <description>&lt;P&gt;This is the general framework to achieve that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(Your base search 1 e.g. index=A sourcetypeA) OR (Your base search 2 e.g. index=B sourcetypeB) | stats values(Field1) as Field1  values(Field2) as Field2.... by commonField
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where Field1, Field2 are the fields, from both base searches, that you want to display and common field is the field common between those two searches.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2016 18:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-data-from-2-source-types/m-p/241732#M188927</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-22T18:36:41Z</dc:date>
    </item>
  </channel>
</rss>

