<?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: null events while using spath in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351600#M104074</link>
    <description>&lt;P&gt;Thanks a lot @ somesoni2.  i was able to use your regex with sed to make the null event as NA and it worked perfectly.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Sep 2017 18:16:48 GMT</pubDate>
    <dc:creator>sasamudr</dc:creator>
    <dc:date>2017-09-20T18:16:48Z</dc:date>
    <item>
      <title>null events while using spath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351598#M104072</link>
      <description>&lt;P&gt;JSON: &lt;/P&gt;

&lt;P&gt;"mainArray":&lt;BR /&gt;
[&lt;BR /&gt;
    {"name":"MS","value":20},&lt;BR /&gt;
    {"name":"MC","value":20},&lt;BR /&gt;
    {"name":"CF","value":20},&lt;BR /&gt;
    {"name":"ST"},&lt;BR /&gt;
    {"name":"CMR","value":20}&lt;BR /&gt;
]&lt;/P&gt;

&lt;P&gt;-- i am currently using the search as " | spath output=code path=mainArray{}.name | spath output=cnt path=mainArray{}.value  | table code,cnt"&lt;/P&gt;

&lt;P&gt;and the output i see is as :&lt;/P&gt;

&lt;P&gt;code  cnt&lt;BR /&gt;
MS      20&lt;BR /&gt;
MC      20&lt;BR /&gt;
CF      20&lt;BR /&gt;
ST      20&lt;BR /&gt;
CMR&lt;/P&gt;

&lt;P&gt;The Expected Output is:&lt;/P&gt;

&lt;P&gt;code  cnt&lt;BR /&gt;
MS      20&lt;BR /&gt;
MC      20&lt;BR /&gt;
CF      20&lt;BR /&gt;
ST&lt;BR /&gt;&lt;BR /&gt;
CMR        20&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 07:20:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351598#M104072</guid>
      <dc:creator>sasamudr</dc:creator>
      <dc:date>2017-09-20T07:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: null events while using spath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351599#M104073</link>
      <description>&lt;P&gt;Try like this  (runanywhere sample. Everything before &lt;CODE&gt;| rex&lt;/CODE&gt; command is for generating sample data, replace that with your base search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 | eval _raw="{\"mainArray\":
[
 {\"name\":\"MS\",\"value\":20},
 {\"name\":\"MC\",\"value\":20},
 {\"name\":\"CF\",\"value\":20},
 {\"name\":\"ST\"},
 {\"name\":\"CMR\",\"value\":20}
]}" | table _raw 
| rex mode=sed "s/(\"name\":\"[^\"]+\")\}/\1,\"value\":\"NA\"}/g" | spath  | spath output=code path=mainArray{}.name | spath output=cnt path=mainArray{}.value | table code,cnt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 17:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351599#M104073</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-20T17:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: null events while using spath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351600#M104074</link>
      <description>&lt;P&gt;Thanks a lot @ somesoni2.  i was able to use your regex with sed to make the null event as NA and it worked perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 18:16:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/null-events-while-using-spath/m-p/351600#M104074</guid>
      <dc:creator>sasamudr</dc:creator>
      <dc:date>2017-09-20T18:16:48Z</dc:date>
    </item>
  </channel>
</rss>

