<?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: POST request using Http Event Controller to Splunk Enterprise - Issue with documentation in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366484#M5955</link>
    <description>&lt;P&gt;Found this question while researching a "ERROR JsonLineBreaker" "Unexpected character" events in my Splunk. I tried to re-create the error using Splunk 7.1.2 but the provided curl command fails due invalid JSON.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;curl -k &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk ${TOKEN}" -d '{"event": "Hello, McKinley High!", "sourcetype": "_json", "fields": {"club":"glee", "wins",["regionals","nationals"]}}'&lt;BR /&gt;
{"text":"Invalid dataformat","code":6,"invalid-event-number":0}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;"wins" is followed by a "," when it should be a ":". Correcting the issue yields a "Success" message w/ no "ERROR JsonLineBreaker" logged.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;curl -k &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk ${TOKEN}" -d '{"event": "Hello, McKinley High!", "sourcetype": "_json", "fields": {"club":"glee", "wins": ["regionals","nationals"]}}'; echo&lt;BR /&gt;
{"text":"Success","code":0}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;FWIW, the JSON typo came from Splunk's "Explicit JSON fields" example at:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAFB6"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAFB6&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 08:25:05 GMT</pubDate>
    <dc:creator>Jason_S</dc:creator>
    <dc:date>2019-02-08T08:25:05Z</dc:date>
    <item>
      <title>POST request using Http Event Controller to Splunk Enterprise - Issue with documentation</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366482#M5953</link>
      <description>&lt;P&gt;Hello Splunk experts, &lt;BR /&gt;
I have been experimenting with the Http Event Controller for Splunk Enterprise and was trying to POST , JSON data, with the 'fields' parameter in order to allow better indexing. &lt;BR /&gt;
I am using this &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAFB6" target="_blank"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAFB6&lt;/A&gt; &lt;BR /&gt;
The request is:&lt;BR /&gt;
&lt;EM&gt;curl -k &lt;A href="https://mysplunkserver.example.com:8088/services/collector/event" target="_blank"&gt;https://mysplunkserver.example.com:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk 12345678-1234-1234-1234-1234567890AB" -d '{"event": "Hello, McKinley High!", "sourcetype": "_json", "fields": {"club":"glee", "wins",["regionals","nationals"]}}'&lt;/EM&gt; . However, this results in an error in the logs: &lt;BR /&gt;
&lt;STRONG&gt;ERROR JsonLineBreaker - JSON StreamId:0 had parsing error:Unexpected character while looking for value: 'H' - data_source="http:force_ocr", data_host="localhost:8088", data_sourcetype="_json"&lt;/STRONG&gt;&lt;BR /&gt;
Is the example in the splunk documentation incorrect? What is the right way to use the 'fields' parameter?&lt;BR /&gt;
Thank you for helping out here!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366482#M5953</guid>
      <dc:creator>priyankatiwari</dc:creator>
      <dc:date>2020-09-29T19:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: POST request using Http Event Controller to Splunk Enterprise - Issue with documentation</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366483#M5954</link>
      <description>&lt;P&gt;Could you give the link to the example in the docs?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 10:47:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366483#M5954</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-04-29T10:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: POST request using Http Event Controller to Splunk Enterprise - Issue with documentation</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366484#M5955</link>
      <description>&lt;P&gt;Found this question while researching a "ERROR JsonLineBreaker" "Unexpected character" events in my Splunk. I tried to re-create the error using Splunk 7.1.2 but the provided curl command fails due invalid JSON.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;curl -k &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk ${TOKEN}" -d '{"event": "Hello, McKinley High!", "sourcetype": "_json", "fields": {"club":"glee", "wins",["regionals","nationals"]}}'&lt;BR /&gt;
{"text":"Invalid dataformat","code":6,"invalid-event-number":0}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;"wins" is followed by a "," when it should be a ":". Correcting the issue yields a "Success" message w/ no "ERROR JsonLineBreaker" logged.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;curl -k &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk ${TOKEN}" -d '{"event": "Hello, McKinley High!", "sourcetype": "_json", "fields": {"club":"glee", "wins": ["regionals","nationals"]}}'; echo&lt;BR /&gt;
{"text":"Success","code":0}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;FWIW, the JSON typo came from Splunk's "Explicit JSON fields" example at:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAFB6"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAFB6&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 08:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/POST-request-using-Http-Event-Controller-to-Splunk-Enterprise/m-p/366484#M5955</guid>
      <dc:creator>Jason_S</dc:creator>
      <dc:date>2019-02-08T08:25:05Z</dc:date>
    </item>
  </channel>
</rss>

