<?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 Display only differences in values, between 2 events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328040#M175308</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
 I'm looking events that track changes to a configuration.  The first event is the "before" state the newest event is the "after" state.  There  events are in json format and there are &amp;gt; 80 fields.  I have a search that will display all of the values for each field present, but it's not practical to display a table with 80 columns and expect the user to locate the columns with multiple values.  &lt;/P&gt;

&lt;P&gt;Here are 2 very sanitized events.&lt;/P&gt;

&lt;P&gt;After Mod Event --&lt;BR /&gt;
{ &lt;BR /&gt;
"EventTime" : "02/23/2017-09:07:47", &lt;BR /&gt;
"EventName" :  "ChangeObject", &lt;BR /&gt;
"EventType" :  "Configuration", &lt;BR /&gt;
"MQLONG MsgSeqNumber" : "2(0x00000002)", &lt;BR /&gt;
"MQCA_ALTERATION_DATE" : "2017-02-23", &lt;BR /&gt;
"MQCA_ALTERATION_TIME" : "09.07.47", &lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Before Mod Event --&lt;BR /&gt;
{ &lt;BR /&gt;
"EventTime" : "02/23/2017-09:07:47", &lt;BR /&gt;
"EventName" :  "ChangeObject", &lt;BR /&gt;
"EventType" :  "Configuration", &lt;BR /&gt;
"MQLONG MsgSeqNumber" : "1(0x00000001)", &lt;BR /&gt;
"MQCA_ALTERATION_DATE" : "2017-02-23", &lt;BR /&gt;
"MQCA_ALTERATION_TIME" : "09.01.47", &lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;This stats command  gives me the values  for each field.&lt;BR /&gt;
... | stats  values(*) AS * &lt;/P&gt;

&lt;P&gt;All I want to see are the fields that are different, in this case the "MQLONG MsgSeqNumber" and "MQCA_ALTERATION_TIME".  Amny of the fields are all text.  Again, there can be over 80 continually changing fields, so I can't write anything that lists specific fields.   This seems like something that should be  fairly common, but I can't find any threads that answer my specific need. &lt;/P&gt;

&lt;P&gt;Hoping someone can share what they've done or tackle this challenge &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:02:55 GMT</pubDate>
    <dc:creator>chengka</dc:creator>
    <dc:date>2020-09-29T13:02:55Z</dc:date>
    <item>
      <title>Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328040#M175308</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
 I'm looking events that track changes to a configuration.  The first event is the "before" state the newest event is the "after" state.  There  events are in json format and there are &amp;gt; 80 fields.  I have a search that will display all of the values for each field present, but it's not practical to display a table with 80 columns and expect the user to locate the columns with multiple values.  &lt;/P&gt;

&lt;P&gt;Here are 2 very sanitized events.&lt;/P&gt;

&lt;P&gt;After Mod Event --&lt;BR /&gt;
{ &lt;BR /&gt;
"EventTime" : "02/23/2017-09:07:47", &lt;BR /&gt;
"EventName" :  "ChangeObject", &lt;BR /&gt;
"EventType" :  "Configuration", &lt;BR /&gt;
"MQLONG MsgSeqNumber" : "2(0x00000002)", &lt;BR /&gt;
"MQCA_ALTERATION_DATE" : "2017-02-23", &lt;BR /&gt;
"MQCA_ALTERATION_TIME" : "09.07.47", &lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;Before Mod Event --&lt;BR /&gt;
{ &lt;BR /&gt;
"EventTime" : "02/23/2017-09:07:47", &lt;BR /&gt;
"EventName" :  "ChangeObject", &lt;BR /&gt;
"EventType" :  "Configuration", &lt;BR /&gt;
"MQLONG MsgSeqNumber" : "1(0x00000001)", &lt;BR /&gt;
"MQCA_ALTERATION_DATE" : "2017-02-23", &lt;BR /&gt;
"MQCA_ALTERATION_TIME" : "09.01.47", &lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;This stats command  gives me the values  for each field.&lt;BR /&gt;
... | stats  values(*) AS * &lt;/P&gt;

&lt;P&gt;All I want to see are the fields that are different, in this case the "MQLONG MsgSeqNumber" and "MQCA_ALTERATION_TIME".  Amny of the fields are all text.  Again, there can be over 80 continually changing fields, so I can't write anything that lists specific fields.   This seems like something that should be  fairly common, but I can't find any threads that answer my specific need. &lt;/P&gt;

&lt;P&gt;Hoping someone can share what they've done or tackle this challenge &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328040#M175308</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2020-09-29T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328041#M175309</link>
      <description>&lt;P&gt;I missed an &lt;EM&gt;, should be   "|  stats  values(&lt;/EM&gt;) AS *" &lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 21:49:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328041#M175309</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2017-02-28T21:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328042#M175310</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats values(*) AS * count(*) AS count* dc(*) AS dc* | foreach count* [eval '&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;'=if(($&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;$=$dc&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;$), null(), $&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;$)] | fields - count* dc* | table *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Feb 2017 22:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328042#M175310</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-28T22:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328043#M175311</link>
      <description>&lt;P&gt;Thank you.  I saw that answer in another thread, but it doesn't work for me.  I get this error.  I don't even have that field..  stumped..&lt;BR /&gt;
       Failed to parse templatized search for field 'counttag::eventtype'&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 22:25:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328043#M175311</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2017-02-28T22:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328044#M175312</link>
      <description>&lt;P&gt;Give this a try. Assuming you've only two events so, if the value is same for a field, values(field) will give a single value (mvcount will be 1).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | stats values(*) as *  | eval temp=1 
| untable temp fieldname fieldvalue | where mvcount(fieldvalue)!=1
| xyseries temp fieldname fieldvalue | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Feb 2017 22:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328044#M175312</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-28T22:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328045#M175313</link>
      <description>&lt;P&gt;Try my updated answer to account for the colons in your field names.  It will work on the search bar but not in a dashboard panel without extra modification.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 02:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328045#M175313</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-01T02:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328046#M175314</link>
      <description>&lt;P&gt;I was thinking something like that.  Required assumption is that there are exactly two events returned from the underlying search.  &lt;/P&gt;

&lt;P&gt;What's the advantage of using xyseries here?  &lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 05:26:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328046#M175314</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-01T05:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328047#M175315</link>
      <description>&lt;P&gt;Thank you, I will try it, but I don't see any colons in my field names, just the separator.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 15:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328047#M175315</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2017-03-01T15:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328048#M175316</link>
      <description>&lt;P&gt;It is right there in the error: a field named &lt;CODE&gt;tag::eventtype&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 15:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328048#M175316</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-01T15:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328049#M175317</link>
      <description>&lt;P&gt;xyseries was to revert to original result format (&lt;CODE&gt;stats values(*) as *&lt;/CODE&gt; gives a column for each field). Filtering is easier with rows so I untabled columns to row,, filtered it and then reverted to original format.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 15:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328049#M175317</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-01T15:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328050#M175318</link>
      <description>&lt;P&gt;Thank you for your patience.  I ran the search and it returns all fields, not only those that are different.  This is what I saw when I tried this solution from another thread.&lt;/P&gt;

&lt;P&gt;source="splunkanswers.txt" index=testing | stats values(&lt;EM&gt;) AS * count(&lt;/EM&gt;) AS count* dc(&lt;EM&gt;) AS dc&lt;/EM&gt; | foreach count* [eval '&amp;lt;&amp;gt;'=if(($&amp;lt;&amp;gt;$=$dc&amp;lt;&amp;gt;$), null(), $&amp;lt;&amp;gt;$)] | fields - count* dc* | table *&lt;/P&gt;

&lt;P&gt;Here is partial result exported to csv.  Several of the fields shown only have 1 value. &lt;BR /&gt;
EventName   EventTime   MQCA_ALTERATION_DATE    MQCA_ALTERATION_TIME    MQLONG MsgSeqNumber date_hour   date_mday&lt;BR /&gt;
ChangeObject    02/23/2017-09:07:47 42789   09.01.47 09.07.47   1(0x00000001) 2(0x00000002) 9   23&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:05:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328050#M175318</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2020-09-29T13:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328051#M175319</link>
      <description>&lt;P&gt;Give the other answer a try.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328051#M175319</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-01T16:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328052#M175320</link>
      <description>&lt;P&gt;The idea of value counts was the way I was thinking.  I tried your solution and it doesn't find any results, buy trimming back the search I can see that it lists the values, but the where clause doesn't return any data.  Maybe I need to reencode the untabled data as MV..&lt;BR /&gt;&lt;BR /&gt;
temp    fieldname   fieldvalue&lt;BR /&gt;
1   EventName   ChangeObject&lt;BR /&gt;
1   EventTime   02/23/2017-09:07:47&lt;BR /&gt;
1   MQCA_ALTERATION_DATE    2017-02-23&lt;BR /&gt;
1   MQCA_ALTERATION_TIME    09.01.47 09.07.47&lt;BR /&gt;
1   MQLONG MsgSeqNumber 1(0x00000001) 2(0x00000002)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328052#M175320</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2020-09-29T13:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328053#M175321</link>
      <description>&lt;P&gt;Lets give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | stats values(*) as *  delim="##" | eval temp=1 
 | untable temp fieldname fieldvalue | makemv fieldvalue delim="##" | where mvcount(fieldvalue)!=1
 | xyseries temp fieldname fieldvalue | fields - temp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Mar 2017 16:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328053#M175321</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-01T16:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Display only differences in values, between 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328054#M175322</link>
      <description>&lt;P&gt;That worked!  I added some OR statements to the where, so I can see other relevant fields that identify the resource.  Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2017 20:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-differences-in-values-between-2-events/m-p/328054#M175322</guid>
      <dc:creator>chengka</dc:creator>
      <dc:date>2017-03-01T20:01:23Z</dc:date>
    </item>
  </channel>
</rss>

