<?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 Why splunk Search returning duplicates? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593479#M206559</link>
    <description>&lt;P&gt;As shown below I have only two events present on my index&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_norm.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19041iB4739A7E882A5E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk_norm.png" alt="splunk_norm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when i execute the below search query&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index = **** |rex field=_raw "(?msi)(?&amp;lt;json_field&amp;gt;\{.+\}$)" | spath input=json_field |rename SCMSplunkLog.SCMFailureLog.appName as APPNAME,SCMSplunkLog.SCMFailureLog.eventType as EVENTTYPE,SCMSplunkLog.SCMFailureLog.payload.level as LEVEL,SCMSplunkLog.SCMFailureLog.payload.errorDescription as ERRORDESCRIPTION,SCMSplunkLog.SCMFailureLog.payload.startTime as STARTDATE,SCMSplunkLog.SCMFailureLog.payload.endTime as ENDDATE |where APPNAME!="" and LEVEL="ERROR"|table APPNAME,EVENTTYPE,STARTDATE,ENDDATE,LEVEL,ERRORDESCRIPTION&lt;/P&gt;&lt;P&gt;I was getting duplicate entries on result table as below&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_general_search.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19042i82BDDDD6AB56978F/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk_general_search.PNG" alt="splunk_general_search.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help me with this.&lt;BR /&gt;&lt;BR /&gt;Edited:&lt;BR /&gt;Attached sample json:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "SCMSplunkLog" : {
    "SCMFailureLog" : {
      "appName" : "Testing_splunk_alerts_log",
      "eventType" : "Testing_splunk_alerts_log",
      "payload" : {
        "level" : "ERROR",
        "startTime" : "2022-04-12T13:57:49.156Z",
        "successCount" : 0,
        "failureCount" : 0,
        "publishedCount" : 0,
        "errorCode" : 0,
        "errorDescription" : "ERROR: relation \"test.testLand\" does not exist\n  Position: 8",
        "sourceCount" : 0,
        "endTime" : "2022-04-12T13:57:54.483Z"
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 05:44:27 GMT</pubDate>
    <dc:creator>karthi25</dc:creator>
    <dc:date>2022-04-13T05:44:27Z</dc:date>
    <item>
      <title>Why splunk Search returning duplicates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593479#M206559</link>
      <description>&lt;P&gt;As shown below I have only two events present on my index&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_norm.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19041iB4739A7E882A5E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk_norm.png" alt="splunk_norm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when i execute the below search query&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;index = **** |rex field=_raw "(?msi)(?&amp;lt;json_field&amp;gt;\{.+\}$)" | spath input=json_field |rename SCMSplunkLog.SCMFailureLog.appName as APPNAME,SCMSplunkLog.SCMFailureLog.eventType as EVENTTYPE,SCMSplunkLog.SCMFailureLog.payload.level as LEVEL,SCMSplunkLog.SCMFailureLog.payload.errorDescription as ERRORDESCRIPTION,SCMSplunkLog.SCMFailureLog.payload.startTime as STARTDATE,SCMSplunkLog.SCMFailureLog.payload.endTime as ENDDATE |where APPNAME!="" and LEVEL="ERROR"|table APPNAME,EVENTTYPE,STARTDATE,ENDDATE,LEVEL,ERRORDESCRIPTION&lt;/P&gt;&lt;P&gt;I was getting duplicate entries on result table as below&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk_general_search.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19042i82BDDDD6AB56978F/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk_general_search.PNG" alt="splunk_general_search.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone please help me with this.&lt;BR /&gt;&lt;BR /&gt;Edited:&lt;BR /&gt;Attached sample json:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "SCMSplunkLog" : {
    "SCMFailureLog" : {
      "appName" : "Testing_splunk_alerts_log",
      "eventType" : "Testing_splunk_alerts_log",
      "payload" : {
        "level" : "ERROR",
        "startTime" : "2022-04-12T13:57:49.156Z",
        "successCount" : 0,
        "failureCount" : 0,
        "publishedCount" : 0,
        "errorCode" : 0,
        "errorDescription" : "ERROR: relation \"test.testLand\" does not exist\n  Position: 8",
        "sourceCount" : 0,
        "endTime" : "2022-04-12T13:57:54.483Z"
      }
    }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 05:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593479#M206559</guid>
      <dc:creator>karthi25</dc:creator>
      <dc:date>2022-04-13T05:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why splunk Search returning duplicates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593488#M206563</link>
      <description>&lt;P&gt;Could you please give us sample JSON raw events. paste in &amp;lt;/&amp;gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 17:46:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593488#M206563</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2022-04-12T17:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why splunk Search returning duplicates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593547#M206592</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/172209"&gt;@mayurr98&lt;/a&gt;&amp;nbsp; updated my post with&amp;nbsp; sample JSON&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 05:46:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593547#M206592</guid>
      <dc:creator>karthi25</dc:creator>
      <dc:date>2022-04-13T05:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why splunk Search returning duplicates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593552#M206595</link>
      <description>&lt;P&gt;I tried the same that you have. It seems working as expected.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="{
  \"SCMSplunkLog\" : {
    \"SCMFailureLog\" : {
      \"appName\" : \"Testing_splunk_alerts_log\",
      \"eventType\" : \"Testing_splunk_alerts_log\",
      \"payload\" : {
        \"level\" : \"ERROR\",
        \"startTime\" : \"2022-04-12T13:57:49.156Z\",
        \"successCount\" : 0,
        \"failureCount\" : 0,
        \"publishedCount\" : 0,
        \"errorCode\" : 0,
        \"errorDescription\" : \"ERROR: relation \"test.testLand\" does not exist\n  Position: 8\",
        \"sourceCount\" : 0,
        \"endTime\" : \"2022-04-12T13:57:54.483Z\"
      }
    }
  }
}"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VatsalJagani_0-1649829821656.png" style="width: 754px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19048i59A00A78BE7A98A3/image-dimensions/754x115?v=v2" width="754" height="115" role="button" title="VatsalJagani_0-1649829821656.png" alt="VatsalJagani_0-1649829821656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 06:04:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-splunk-Search-returning-duplicates/m-p/593552#M206595</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-13T06:04:06Z</dc:date>
    </item>
  </channel>
</rss>

