<?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: When building a modular input, how to index JSON data? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323696#M60262</link>
    <description>&lt;P&gt;This may help:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/620832/error-execprocessor-message-from-scriptpy-error-ca.html"&gt;https://answers.splunk.com/answers/620832/error-execprocessor-message-from-scriptpy-error-ca.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 04:46:40 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-04-10T04:46:40Z</dc:date>
    <item>
      <title>When building a modular input, how to index JSON data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323695#M60261</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am building a modular input using Add-on Building and python.&lt;BR /&gt;
When I am trying to index JSON data I get this error: "ERRORcannot serialize {u'rule-number': 1, u'type': u'access-rule..."&lt;/P&gt;

&lt;P&gt;Any clue about this issue?&lt;/P&gt;

&lt;P&gt;The relevant portion of code is: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;res =  json.load(response)   
 rules = res['rulebase']
 for rule in rules:
            event = helper.new_event(source=helper.get_input_type(), index=helper.get_output_index(), sourcetype=helper.get_sourcetype(), data=rule)
        ew.write_event(event)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 11:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323695#M60261</guid>
      <dc:creator>apezuela</dc:creator>
      <dc:date>2018-04-09T11:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: When building a modular input, how to index JSON data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323696#M60262</link>
      <description>&lt;P&gt;This may help:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/620832/error-execprocessor-message-from-scriptpy-error-ca.html"&gt;https://answers.splunk.com/answers/620832/error-execprocessor-message-from-scriptpy-error-ca.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 04:46:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323696#M60262</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-10T04:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: When building a modular input, how to index JSON data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323697#M60263</link>
      <description>&lt;P&gt;try json.dump before you write the events&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 22:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323697#M60263</guid>
      <dc:creator>smoir_splunk</dc:creator>
      <dc:date>2018-08-15T22:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: When building a modular input, how to index JSON data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323698#M60264</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Have you looked at the structure of the raw data ? Splunk modular input is sending data as a xml, and therefor you json parsing fails. i am myself unsure how this is expected to work.&lt;/P&gt;

&lt;P&gt;raw event&lt;BR /&gt;
2018-10-22T13:05:51.329000+0200{'test': 'Issue', 'time': '2018-10-22T13:05:51.329000+0200'}&lt;/P&gt;

&lt;P&gt;real event&lt;BR /&gt;
{'test': 'Issue', 'time': '2018-10-22T13:05:51.329000+0200'}&lt;/P&gt;

&lt;P&gt;related post&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/693177/parsing-of-splunk-modular-input-with-json-data.html"&gt;https://answers.splunk.com/answers/693177/parsing-of-splunk-modular-input-with-json-data.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 11:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/When-building-a-modular-input-how-to-index-JSON-data/m-p/323698#M60264</guid>
      <dc:creator>AndersNierhoff</dc:creator>
      <dc:date>2018-10-22T11:09:11Z</dc:date>
    </item>
  </channel>
</rss>

