<?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: Creating a comparison report in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297482#M3785</link>
    <description>&lt;P&gt;@mayurr98,&lt;/P&gt;

&lt;P&gt;Apologies, I should have mentioned, the fields from the two different sources will have the same name. &lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2018 09:57:51 GMT</pubDate>
    <dc:creator>mahbs</dc:creator>
    <dc:date>2018-01-08T09:57:51Z</dc:date>
    <item>
      <title>Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297479#M3782</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to create  report, where I am extracting data from two different sources. This data being extracted from both sources share the same item number value. So the structure is something like this:&lt;/P&gt;

&lt;P&gt;ITEM  | src1 Field 1 | src1 Field 2 | src2 Field 1 | src2 Field 2&lt;BR /&gt;
11111           0                                     0                      0                       0&lt;BR /&gt;
12121          8                              8                              8                       8&lt;BR /&gt;
13222           7                               7                            7                         7&lt;/P&gt;

&lt;P&gt;Essentially, what I want to do is extract data from both sources for the relevant fields for a specific ITEM.&lt;/P&gt;

&lt;P&gt;Can someone suggest what I can do to achieve this?&lt;/P&gt;

&lt;P&gt;EDIT:&lt;BR /&gt;
Apologies, I haven't been able to seperate the values for each fields. Basically, Each src field has only on Integer value.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297479#M3782</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-08T09:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297480#M3783</link>
      <description>&lt;P&gt;Hey &lt;/P&gt;

&lt;P&gt;If you have different field name for both sources then try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=source1 OR source=source2 ITEM=&amp;lt;item_number&amp;gt; | stats values(src1_field1) as "src1_field1"  values(src1_field2) as "src1_field2"  values(src2_field1) as "src2_field1" values(src2_field2) as "src2_field2" by ITEM 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps you!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297480#M3783</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-08T09:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297481#M3784</link>
      <description>&lt;P&gt;Hi @mayurr98,&lt;/P&gt;

&lt;P&gt;Quick question, what does ITEM= do? I understand with the others, you're displaying the values of the fields according to ITEM.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297481#M3784</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-08T09:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297482#M3785</link>
      <description>&lt;P&gt;@mayurr98,&lt;/P&gt;

&lt;P&gt;Apologies, I should have mentioned, the fields from the two different sources will have the same name. &lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 09:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297482#M3785</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-08T09:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297483#M3786</link>
      <description>&lt;P&gt;Try this then:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=&amp;lt;your_index&amp;gt; source=source1 ITEM=&amp;lt;item_number&amp;gt; field1=* field2=* | stats values(field1) as "src1_field1"  values(field2) as "src1_field2"  by ITEM | join ITEM [search index=&amp;lt;your_index&amp;gt; source=source2 ITEM=&amp;lt;item_number&amp;gt; field1=* field2=* | stats values(field1) as "src2_field1"  values(field2) as "src2_field2"  by ITEM] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so your output will be&lt;BR /&gt;
ITEM src1_field1 src1_field2 src2_field1 src2_field2&lt;BR /&gt;
1111 0 0 0 0&lt;BR /&gt;
2222 1 1 1 1&lt;/P&gt;

&lt;P&gt;Let me know if this works!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297483#M3786</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2020-09-29T17:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297484#M3787</link>
      <description>&lt;P&gt;Will do! Thanks for your speedy response @mayurrr98! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 10:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297484#M3787</guid>
      <dc:creator>mahbs</dc:creator>
      <dc:date>2018-01-08T10:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comparison report</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297485#M3788</link>
      <description>&lt;P&gt;Also for fast result you should write &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=export14 ITEM=$item_number$". sourcetype=csv | stats values(src1_field1) as field1 values(src1_field2) as field2 BY ITEM | rename ITEM as item_number | map search = "search index=export8 sourcetype=csv src2_item=$item_number$" | stats values(src2_field1) as field1 values(src2_field2) as field2 BY src2_item| rename src_item as item_number 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 16:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Creating-a-comparison-report/m-p/297485#M3788</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-08T16:57:33Z</dc:date>
    </item>
  </channel>
</rss>

