<?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 How to find difference in JSON file as in given below? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-difference-in-JSON-file-as-in-given-below/m-p/603486#M105008</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Below events is in splunk .We have two repos in git 1. AAA 2.BBB.When ever the repos will replicate and both repos should be same file. But in my case after replicate both repos files are missing so i should compare the files and whare are the files is missing and send an alert as difference in repos.&lt;/P&gt;&lt;H5&gt;INTERESTING FIELDS:&lt;/H5&gt;&lt;P&gt;CODE.Modified_files{}&lt;/P&gt;&lt;P&gt;TOOLKIT.Modified_files{}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output after comparing:&lt;/P&gt;&lt;P&gt;CODE.Modified_files{}&lt;/P&gt;&lt;P&gt;"a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/logs/refs/heads/master",&lt;BR /&gt;"a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/version.json"&lt;/P&gt;&lt;P&gt;TOOLKIT.Modified_files{}&lt;/P&gt;&lt;P&gt;"a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/logs/refs/heads/master"&lt;/P&gt;&lt;P&gt;These files are only present in AAA repo but not in BBB. So we need compare both AAA and BBB missing files. As per the event and show the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;{
  "CODE": {
    "modified_files": [
      "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/HEAD", 
      "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/config", 
      "a/D:\\\\splunk_code_replication\\\\BBB_CODE/.git/HEAD", 
	  "a/D:\\\\splunk_code_replication\\\\BBB_CODE/.git/config",
	  "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/logs/refs/heads/master",
	  "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/version.json"
	  ]
	  }
	}
	{
  "TOOlKIT": {
    "modified_files": [
      "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/HEAD", 
      "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/config", 
      "a/D:\\\\splunk_code_replication\\\\BBB_TOOLKIT/.git/HEAD", 
	  "a/D:\\\\splunk_code_replication\\\\BBB_TOOLKIT/.git/config",
	  "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/logs/refs/heads/master", 
	  ]
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 03:23:20 GMT</pubDate>
    <dc:creator>karthi2809</dc:creator>
    <dc:date>2022-06-28T03:23:20Z</dc:date>
    <item>
      <title>How to find difference in JSON file as in given below?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-difference-in-JSON-file-as-in-given-below/m-p/603486#M105008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Below events is in splunk .We have two repos in git 1. AAA 2.BBB.When ever the repos will replicate and both repos should be same file. But in my case after replicate both repos files are missing so i should compare the files and whare are the files is missing and send an alert as difference in repos.&lt;/P&gt;&lt;H5&gt;INTERESTING FIELDS:&lt;/H5&gt;&lt;P&gt;CODE.Modified_files{}&lt;/P&gt;&lt;P&gt;TOOLKIT.Modified_files{}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output after comparing:&lt;/P&gt;&lt;P&gt;CODE.Modified_files{}&lt;/P&gt;&lt;P&gt;"a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/logs/refs/heads/master",&lt;BR /&gt;"a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/version.json"&lt;/P&gt;&lt;P&gt;TOOLKIT.Modified_files{}&lt;/P&gt;&lt;P&gt;"a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/logs/refs/heads/master"&lt;/P&gt;&lt;P&gt;These files are only present in AAA repo but not in BBB. So we need compare both AAA and BBB missing files. As per the event and show the difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;{
  "CODE": {
    "modified_files": [
      "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/HEAD", 
      "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/config", 
      "a/D:\\\\splunk_code_replication\\\\BBB_CODE/.git/HEAD", 
	  "a/D:\\\\splunk_code_replication\\\\BBB_CODE/.git/config",
	  "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/logs/refs/heads/master",
	  "a/D:\\\\splunk_code_replication\\\\AAA_CODE/.git/version.json"
	  ]
	  }
	}
	{
  "TOOlKIT": {
    "modified_files": [
      "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/HEAD", 
      "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/config", 
      "a/D:\\\\splunk_code_replication\\\\BBB_TOOLKIT/.git/HEAD", 
	  "a/D:\\\\splunk_code_replication\\\\BBB_TOOLKIT/.git/config",
	  "a/D:\\\\splunk_code_replication\\\\AAA_TOOLKIT/.git/logs/refs/heads/master", 
	  ]
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 03:23:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-difference-in-JSON-file-as-in-given-below/m-p/603486#M105008</guid>
      <dc:creator>karthi2809</dc:creator>
      <dc:date>2022-06-28T03:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference in JSON file as in given below?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-difference-in-JSON-file-as-in-given-below/m-p/604162#M105078</link>
      <description>&lt;P&gt;Assuming each event covers one repository and has a field called json with the files&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath input=json
| foreach *.modified_files{}
    [| eval repo=if(isnotnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),"&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;",repo)
    | eval modified_files=if(isnotnull('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'),'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',modified_files)]
| fields - *.modified_files{}
| eval modified_files=mvmap(modified_files,replace(modified_files,"AAA_".repo,"repo"))
| eval modified_files=mvmap(modified_files,replace(modified_files,"BBB_".repo,"repo"))
| streamstats count as row
| stats values(json) as json count by row modified_files
| where count = 1
| stats values(modified_files) as modified_files values(json) as json by row&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 18:56:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-difference-in-JSON-file-as-in-given-below/m-p/604162#M105078</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-01T18:56:19Z</dc:date>
    </item>
  </channel>
</rss>

