<?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 xml file with Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607473#M211202</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;now it show a table like this:&lt;/P&gt;&lt;P&gt;source&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_raw&lt;/P&gt;&lt;P&gt;/data/xml1&amp;nbsp; &amp;nbsp; &amp;nbsp; content&lt;/P&gt;&lt;P&gt;/data/xml2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;content&lt;/P&gt;&lt;P&gt;i can't see anything that show what is the different between these files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 07:11:21 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2022-07-29T07:11:21Z</dc:date>
    <item>
      <title>How to compare two XML file with Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607455#M211190</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to compare two xml file with Splunk to find changes, is it possible?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nameislocus/jboss-eap-6-scripts/blob/master/domain/configuration/domain.xml" target="_self"&gt;sample file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 05:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607455#M211190</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T05:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607457#M211192</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;yes, it's possible.&lt;/P&gt;&lt;P&gt;You have to ingest them, creating an input and indexing them as one or more events.&lt;/P&gt;&lt;P&gt;The you have to run a simple search like the following.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index source IN (source1,source2)
| stats dc(_raw) AS raw_count values(_raw) AS _raw BY source
| where raw_count=1
| table source _raw&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 05:56:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607457#M211192</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-29T05:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two XML file with Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607459#M211194</link>
      <description>&lt;P&gt;Why do you need to use Splunk to do something that it is not intended for and there are other much better tools for this particular job?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 06:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607459#M211194</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-29T06:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607468#M211197</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;should i do something else before add xml files?&lt;/P&gt;&lt;P&gt;because i add "data input" that continiously index this path /data/xml into the index="xml"&lt;/P&gt;&lt;P&gt;but after copy xml file can't see them in splunk!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI: i set source type " automatic"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 06:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607468#M211197</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T06:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607470#M211199</link>
      <description>&lt;P&gt;I edited inputs.conf and added crcSalt = SOURCE to the monitor. It helped.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 06:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607470#M211199</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T06:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607473#M211202</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;now it show a table like this:&lt;/P&gt;&lt;P&gt;source&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_raw&lt;/P&gt;&lt;P&gt;/data/xml1&amp;nbsp; &amp;nbsp; &amp;nbsp; content&lt;/P&gt;&lt;P&gt;/data/xml2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;content&lt;/P&gt;&lt;P&gt;i can't see anything that show what is the different between these files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 07:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607473#M211202</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T07:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607475#M211203</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;using my method you can have the differen files, I cannot highligh the single word.&lt;/P&gt;&lt;P&gt;Differences must be manually find.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 07:21:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607475#M211203</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-29T07:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607476#M211204</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;so it just put two xml beside eachother? compare must be done manually?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 07:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607476#M211204</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T07:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607484#M211209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the above search find if there are some differences betwenn files.&lt;/P&gt;&lt;P&gt;To find differences, you could divide each file in rows, using regexes, and compare them on by one, but it's a big job.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 08:28:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607484#M211209</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-29T08:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607488#M211212</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;As far as I can see actually it’s not detect or show “&lt;SPAN&gt;some differences between files.”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 08:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607488#M211212</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-29T08:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: compare two xml file with Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607571#M211248</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;i can't see anything that show what is the different between these files.&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is your end goal to show something like diff output? As ITWhisperer said, Splunk is not intended to solve that kind of problem.&lt;/P&gt;&lt;P&gt;To make an approximation, assuming that you have the contents of two files in two fields, xml1 and xml2. &amp;nbsp;You can do something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach xml*
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "
") ]
| eval lines = mvrange(0, if(mvcount(xml1) &amp;gt; mvcount(xml2), mvcount(xml1), mvcount(xml2)))
| eval diff = mvmap(lines, mvappend(diff, if(mvindex(xml1, lines) != mvindex(xml2, lines), lines . ":
&amp;lt;" . mvindex(xml1, lines) . "
&amp;gt;" . mvindex(xml2, lines), null())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can give you a very poor facsimile of diff&lt;/P&gt;&lt;TABLE width="492px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="259.21875px"&gt;diff&lt;/TD&gt;&lt;TD width="111.90625px"&gt;&lt;DIV class=""&gt;xml1&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="119.90625px"&gt;&lt;DIV class=""&gt;xml2&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="259.21875px"&gt;1:&lt;DIV&gt;&amp;lt;&amp;lt;somefield /&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;gt;&amp;lt;someother /&amp;gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="111.90625px"&gt;&lt;DIV class=""&gt;&amp;lt;xml&amp;gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;lt;somefield /&amp;gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;lt;/xml&amp;gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="119.90625px"&gt;&lt;DIV class=""&gt;&amp;lt;xml&amp;gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;lt;someother /&amp;gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;lt;/xml&amp;gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Similarly, you can simulate side-by-side diff output, and so on, even unified diff. &amp;nbsp;But any way you slice it, Splunk is not an ideal tool for this.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 17:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-XML-file-with-Splunk/m-p/607571#M211248</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-07-29T17:02:27Z</dc:date>
    </item>
  </channel>
</rss>

