<?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: Compare two mv fields and audit individual results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655521#M226442</link>
    <description>&lt;P&gt;The * is being treated as a special character by the mvfind which is confusing the mvfind function and giving you false positives / false negatives. You could try replace() to change them to something else, then change them back afterwards?&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 16:22:32 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-24T16:22:32Z</dc:date>
    <item>
      <title>How to Compare two mv fields and audit individual results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655497#M226435</link>
      <description>&lt;P&gt;I'm looking specifically at the index for _configtracker to audit changes to serverclass.conf file.&amp;nbsp; Because the nature of the &amp;lt;filtertype&amp;gt;.n = &amp;lt;value&amp;gt; the behavior is one action to remove all values, then a second action to rewrite all the values in lexi order.&amp;nbsp; This is making auditing add/removals/static very difficult.&lt;/P&gt;
&lt;P&gt;I have managed to transact the events so I can compare old values to new values.&amp;nbsp; I struggle with how to compare the results to identify changes when values list is very long.&lt;/P&gt;
&lt;P&gt;Current Table Output&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Unique Ident&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;OldValues&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;NewValues&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;
&lt;PRE&gt;&amp;lt;transact-x&amp;gt;&lt;/PRE&gt;
&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;
&lt;PRE&gt;A&lt;BR /&gt;B&lt;BR /&gt;C&lt;BR /&gt;D&lt;/PRE&gt;
&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;
&lt;PRE&gt;A&lt;BR /&gt;C&lt;BR /&gt;D&lt;BR /&gt;E&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm looking for&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Unique Ident&lt;/TD&gt;
&lt;TD width="25%"&gt;OldValues&lt;/TD&gt;
&lt;TD width="25%"&gt;NewValue&lt;/TD&gt;
&lt;TD width="25%"&gt;Audit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;lt;transact-x&amp;gt;&lt;/TD&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;A&lt;/TD&gt;
&lt;TD width="25%"&gt;NoChange&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;lt;transact-x&amp;gt;&lt;/TD&gt;
&lt;TD width="25%"&gt;B&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;Removed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;lt;transact-x&amp;gt;&lt;/TD&gt;
&lt;TD width="25%"&gt;C&lt;/TD&gt;
&lt;TD width="25%"&gt;C&lt;/TD&gt;
&lt;TD width="25%"&gt;NoChange&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;lt;transact-x&amp;gt;&lt;/TD&gt;
&lt;TD width="25%"&gt;D&lt;/TD&gt;
&lt;TD width="25%"&gt;D&lt;/TD&gt;
&lt;TD width="25%"&gt;NoChange&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;&amp;lt;transact-x&amp;gt;&lt;/TD&gt;
&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="25%"&gt;E&lt;/TD&gt;
&lt;TD width="25%"&gt;Added&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assumptions&lt;/P&gt;
&lt;P&gt;1) stats values(field): I don't believe any of my samples cross over 10,000 which I believe is default limits for values field&lt;/P&gt;
&lt;P&gt;2) values function will lexi order all values regardless of original order in raw data feed&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 17:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655497#M226435</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2023-08-24T17:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two mv fields and audit individual results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655505#M226438</link>
      <description>&lt;P&gt;It is a bit convoluted because you need to create additional events to cover all comparisons.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mvexpand OldValues
| eval Audit=if(isnotnull(mvfind(NewValue,OldValues)),"NoChange","Removed")
| eventstats values(OldValues) as allOldValues by Unique_Ident
| mvexpand NewValue
| eval NewAudit=if(isnotnull(mvfind(allOldValues,NewValue)),null(),"Added")
| eval OldValues=if(NewAudit="Added",null(),OldValues)
| eval NewValue=if(Audit="NoChange" AND isnotnull(OldValues),OldValues,if(Audit="Removed" AND isnotnull(OldValues),null(),NewValue))
| eval Audit=coalesce(NewAudit,Audit)
| fields Unique_Ident OldValues NewValue Audit
| fillnull value="" OldValues NewValue
| dedup Unique_Ident OldValues NewValue Audit&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655505#M226438</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-24T14:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two mv fields and audit individual results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655512#M226439</link>
      <description>&lt;P&gt;This is exactly what I needed.&lt;/P&gt;&lt;P&gt;My unique_ident was actually a collection of fields.&amp;nbsp; I just eval'd them together as a big string with a delim character that I can easily separate out post processing.&lt;/P&gt;&lt;P&gt;One issue that I will not worry too much about but if you have a hint would be good.&amp;nbsp; The values fields are text and can contain an "*" character.&amp;nbsp; Even if the value exists on both columns it is registering as "Added" and "Removed".&amp;nbsp; Because of the nuance I can live with it.&amp;nbsp; However, if I wanted to move this into a dashboard not all users might understand the mechanics.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Unique&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Old&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;New&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;transact-x&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;*_ABCD_*&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;*_ABCD_*&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Results&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Unique&lt;/TD&gt;&lt;TD width="25%"&gt;Old&lt;/TD&gt;&lt;TD width="25%"&gt;New&lt;/TD&gt;&lt;TD width="25%"&gt;Audit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;transact-x&lt;/TD&gt;&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%"&gt;*_ABCD_*&lt;/TD&gt;&lt;TD width="25%"&gt;Added&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;transact-x&lt;/TD&gt;&lt;TD width="25%"&gt;*_ABCD_*&lt;/TD&gt;&lt;TD width="25%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%"&gt;Removed&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655512#M226439</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2023-08-24T15:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two mv fields and audit individual results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655521#M226442</link>
      <description>&lt;P&gt;The * is being treated as a special character by the mvfind which is confusing the mvfind function and giving you false positives / false negatives. You could try replace() to change them to something else, then change them back afterwards?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 16:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Compare-two-mv-fields-and-audit-individual-results/m-p/655521#M226442</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-24T16:22:32Z</dc:date>
    </item>
  </channel>
</rss>

