<?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: Index input script json results -&amp;gt; Issue The json is not broken correctly when  indexed by splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118544#M24600</link>
    <description>&lt;P&gt;I have been able to index any type of valid json structure without any problem using the monitoring file stanza in the inputs.conf&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2014 19:32:31 GMT</pubDate>
    <dc:creator>lpolo</dc:creator>
    <dc:date>2014-01-23T19:32:31Z</dc:date>
    <item>
      <title>Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118538#M24594</link>
      <description>&lt;P&gt;I have a set of input scripts that are working as expected. The problem I am facing is that I need to index the results but the event is not broken correctly. This is an example of the result : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[
{
"a": "4620",
"b": "splunk",
"x": "0",
"d": "3.0",
"e": "50",
"f": "0",
"g": "41.0",
"_time": "2014-01-17T10:26:43.000-05:00",
"h": "abc",
"i": "4620",
"j": "0.00",
"k": "21.0",
"l": "6.00"
},
{
"a": "4620",
"b": "ABC",
"x": "0",
"d": "3.0",
"e": "50",
"f": "0",
"g": "41.0",
"_time": "2014-01-17T10:26:43.000-05:00",
"h": "abc",
"i": "4620",
"j": "0.00",
"k": "21.0",
"l": "6.00"
}
]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is what I have in the inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script:///opt/splunk/bin/scripts/splunk-sdk-python/examples/abc.py]
disabled = 0
index = main
interval = */5 * * * *
sourcetype = feed 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jan 2014 15:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118538#M24594</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2014-01-17T15:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118539#M24595</link>
      <description>&lt;P&gt;In what way is your event not broken correctly?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 23:35:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118539#M24595</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-01-17T23:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118540#M24596</link>
      <description>&lt;P&gt;I believe the JSON log parser expects logs of the format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"key":"value"}
{"key":"othervalue"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I.E. JSON log files aren't JSON, they are files with one JSON object per line.&lt;/P&gt;

&lt;P&gt;So, remove the square brackets and the comma. If that doesn't work, try putting each event on a separate line (so drop the pretty-printing).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2014 13:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118540#M24596</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2014-01-22T13:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118541#M24597</link>
      <description>&lt;P&gt;The event I presented in the original question is a valid Json.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2014 13:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118541#M24597</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2014-01-22T13:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118542#M24598</link>
      <description>&lt;P&gt;Is that result one or two events?&lt;/P&gt;

&lt;P&gt;Edit: Wait, what I meant is that Splunk, when parsing JSON, doesn't expect valid JSON but instead a single JSON object per line. That is at least what I've experienced.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2014 14:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118542#M24598</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2014-01-22T14:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118543#M24599</link>
      <description>&lt;P&gt;it breaks at any position.&lt;BR /&gt;
The work around I did to make it work was to write the results in a file. Then, I monitor file using a monitoring stanza in inputs.conf. I tried to apply the same config to the script stanza but no success.  The config I used in monitoring the file is the following:&lt;/P&gt;

&lt;P&gt;LINE_BREAKER = "(^)[" &lt;BR /&gt;
TRUNCATE = 0&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;I should be able to index the results correctly without doing the presented work around. &lt;/P&gt;

&lt;P&gt;Any idea?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118543#M24599</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2020-09-28T15:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118544#M24600</link>
      <description>&lt;P&gt;I have been able to index any type of valid json structure without any problem using the monitoring file stanza in the inputs.conf&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2014 19:32:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118544#M24600</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2014-01-23T19:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Index input script json results -&gt; Issue The json is not broken correctly when  indexed by splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118545#M24601</link>
      <description>&lt;P&gt;try sourcetype = json instead of feed&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 00:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-input-script-json-results-gt-Issue-The-json-is-not-broken/m-p/118545#M24601</guid>
      <dc:creator>dolivasoh</dc:creator>
      <dc:date>2014-11-25T00:57:40Z</dc:date>
    </item>
  </channel>
</rss>

