<?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: Getting incorrect data while I am using rex splunk in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489872#M8252</link>
    <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;

&lt;P&gt;I tried using with your solution but getting same results.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2020 06:55:52 GMT</pubDate>
    <dc:creator>rashhvarikuti</dc:creator>
    <dc:date>2020-03-10T06:55:52Z</dc:date>
    <item>
      <title>Getting incorrect data while I am using rex splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489869#M8249</link>
      <description>&lt;P&gt;I wrote below query to get the data and display in my dashboard. And I am getting results with correct data + getting additional data too. &lt;/P&gt;

&lt;P&gt;Here is the query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=tap-prod sourcetype=prod jobId=e62-71c72ccb3aec diff
| rex field=_raw "\"diff\":(?.*)}+"
| spath input=message
| extract kvdelim=":" pairdelim="," message
| table fieldName path expValue actValue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the data I am parsing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "tapName": "tapData",
  "tapUuid": "22015f427a12",
  "diff": {
    "actValue": "tap_actualValue",
    "address": ".@gmail.com",
    "diffType": "SAMPLE_DIFFERENCE",
    "expValue": "tap_expectedValue",
    "fieldName": "Sample",
    "fullPath": "/http://www.gmail.com/file",
    "path": "/send"
  }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;While executing above query I am getting below results which is incorrect:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;(fieldName)         ( path )                       (expValue)                  (actValue)               (address)
address":.@gmail.com"  expValue":"tap_expectedValue   actValue":"tap_actualValue   testName":"someOtherVal  `Sample`                                                `/send`                                                 `tap_expectedValue`                          `tap_actualValue`
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 22:56:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489869#M8249</guid>
      <dc:creator>rashhvarikuti</dc:creator>
      <dc:date>2020-03-09T22:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect data while I am using rex splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489870#M8250</link>
      <description>&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{
   \"tapName\": \"tapData\",
   \"tapUuid\": \"22015f427a12\",
   \"diff\": {
     \"actValue\": \"tap_actualValue\",
     \"address\": \".@gmail.com\",
     \"diffType\": \"SAMPLE_DIFFERENCE\",
     \"expValue\": \"tap_expectedValue\",
     \"fieldName\": \"Sample\",
     \"fullPath\": \"/http://www.gmail.com/file\",
     \"path\": \"/send\"
       }
 }" 
| spath diff output=message 
| spath input=message 
| fields - _* message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;actValue,address,diffType,expValue,fieldName,fullPath,path
tap_actualValue,.@gmail.com,SAMPLE_DIFFERENCE,tap_expectedValue,Sample,/http://www.gmail.com/file,/send
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Recommend:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=tap-prod sourcetype=prod jobId=e62-71c72ccb3aec diff 
| spath path=diff output=message
| spath input=message
| fields - _* message
| table fieldName path expValue actValue address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you provide props.conf?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 00:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489870#M8250</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-10T00:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect data while I am using rex splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489871#M8251</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?ms)\"diff\":(?&amp;lt;message&amp;gt;.*)}+" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As in this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{
\"tapName\": \"tapData\",
\"tapUuid\": \"22015f427a12\",
\"diff\": {
\"actValue\": \"tap_actualValue\",
\"address\": \".@gmail.com\",
\"diffType\": \"SAMPLE_DIFFERENCE\",
\"expValue\": \"tap_expectedValue\",
\"fieldName\": \"Sample\",
\"fullPath\": \"/http://www.gmail.com/file\",
\"path\": \"/send\"
    }
}" 
| rex "(?ms)\"diff\":(?&amp;lt;message&amp;gt;.*)}+" 
| spath input=message 
| table fieldName path expValue actValue**
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2020 01:41:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489871#M8251</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-10T01:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect data while I am using rex splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489872#M8252</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;

&lt;P&gt;I tried using with your solution but getting same results.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 06:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489872#M8252</guid>
      <dc:creator>rashhvarikuti</dc:creator>
      <dc:date>2020-03-10T06:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting incorrect data while I am using rex splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489873#M8253</link>
      <description>&lt;P&gt;Thank you for your quick reply.&lt;/P&gt;

&lt;P&gt;I tried with above solution but getting same results.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 07:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Getting-incorrect-data-while-I-am-using-rex-splunk/m-p/489873#M8253</guid>
      <dc:creator>rashhvarikuti</dc:creator>
      <dc:date>2020-03-10T07:21:25Z</dc:date>
    </item>
  </channel>
</rss>

