<?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 JSON/Syslog and SPATH in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Syslog-and-SPATH/m-p/22372#M3422</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have JSON data being indexed from a syslog file i.e&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Nov  2 23:04:47 host1 /usr/local/bin/audit.rb[24503]: { "@fields" : {  "action" : "check", "agent" : "server", "caller" : "user", "callerhost" : "system", "data" : "{:process_results=&amp;gt;true}", "request_time" : 1351746758, "uniqid" : "73670e799fbf576b9225278cc46709c0" }, "@message" : "message", "@source" : "audit", "@source_host" : "host", "@tags" : [  ], "@timestamp" : "2012-11-01T05:12:38.169418Z", "@type" : "audit" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is I cannot use spath to extract fields, i.e&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | spath output=action path=@fields.action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I remove the syslog section and only index the JSON data then it works without problems, i.e if the data is just.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "@fields" : {  "action" : "check", "agent" : "server", "caller" : "user", "callerhost" : "system", "data" : "{:process_results=&amp;gt;true}", "request_time" : 1351746758, "uniqid" : "73670e799fbf576b9225278cc46709c0" }, "@message" : "message", "@source" : "audit", "@source_host" : "host", "@tags" : [  ], "@timestamp" : "2012-11-01T05:12:38.169418Z", "@type" : "audit" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this normal behaviour, is there a way around it whilst still being able to use the spath function?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Nov 2012 23:12:57 GMT</pubDate>
    <dc:creator>matthewparry</dc:creator>
    <dc:date>2012-11-02T23:12:57Z</dc:date>
    <item>
      <title>JSON/Syslog and SPATH</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Syslog-and-SPATH/m-p/22372#M3422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have JSON data being indexed from a syslog file i.e&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Nov  2 23:04:47 host1 /usr/local/bin/audit.rb[24503]: { "@fields" : {  "action" : "check", "agent" : "server", "caller" : "user", "callerhost" : "system", "data" : "{:process_results=&amp;gt;true}", "request_time" : 1351746758, "uniqid" : "73670e799fbf576b9225278cc46709c0" }, "@message" : "message", "@source" : "audit", "@source_host" : "host", "@tags" : [  ], "@timestamp" : "2012-11-01T05:12:38.169418Z", "@type" : "audit" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is I cannot use spath to extract fields, i.e&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | spath output=action path=@fields.action
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I remove the syslog section and only index the JSON data then it works without problems, i.e if the data is just.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ "@fields" : {  "action" : "check", "agent" : "server", "caller" : "user", "callerhost" : "system", "data" : "{:process_results=&amp;gt;true}", "request_time" : 1351746758, "uniqid" : "73670e799fbf576b9225278cc46709c0" }, "@message" : "message", "@source" : "audit", "@source_host" : "host", "@tags" : [  ], "@timestamp" : "2012-11-01T05:12:38.169418Z", "@type" : "audit" }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this normal behaviour, is there a way around it whilst still being able to use the spath function?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2012 23:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Syslog-and-SPATH/m-p/22372#M3422</guid>
      <dc:creator>matthewparry</dc:creator>
      <dc:date>2012-11-02T23:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: JSON/Syslog and SPATH</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Syslog-and-SPATH/m-p/22373#M3423</link>
      <description>&lt;P&gt;this is normal. spath operates on either XML or JSON, and with the extra info, your data is not JSON. You can simply use eval prior to using spath to strip out the syslog info prior to piping to spath.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2012 03:35:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Syslog-and-SPATH/m-p/22373#M3423</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-11-05T03:35:29Z</dc:date>
    </item>
  </channel>
</rss>

