<?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: How to over ride sourcetype using curl command  for Http event collector? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268890#M51631</link>
    <description>&lt;P&gt;Hi Miller,&lt;/P&gt;

&lt;P&gt;Now it is working.I tried like this in windows.&lt;/P&gt;

&lt;P&gt;curl -k &lt;A href="http://localhost:8088/services/collector/event"&gt;http://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk &lt;STRONG&gt;D87*D-F645-&lt;/STRONG&gt;D-A7E4-&lt;STRONG&gt;EA&lt;/STRONG&gt;AD8FC6" -d "{\"time\": 1437522387,\"host\": \"localhost1\",\"source\": \"testapp1\",\"sourcetype\":\"testapp1\",\"index\":\"testindexxxxxx\",\"event\": {\"message\": \"Something happened1\",\"severity\": \"WARN\"}}"&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 20:30:33 GMT</pubDate>
    <dc:creator>mprreddy51</dc:creator>
    <dc:date>2016-03-29T20:30:33Z</dc:date>
    <item>
      <title>How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268884#M51625</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I configured Http Event collector(EC) in my local through GUI (generated token,created index and source type) and  in the backend splunk_httpinput app local got created with inputs.conf.&lt;/P&gt;

&lt;P&gt;[&lt;A href="http://test"&gt;http://test&lt;/A&gt;]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
index = testindex&lt;BR /&gt;
indexes = testindex&lt;BR /&gt;
source = testtt&lt;BR /&gt;
sourcetype = testst&lt;BR /&gt;
token = 8111111111111*********&lt;/P&gt;

&lt;P&gt;and from command prompt if I run the below curl command&lt;/P&gt;

&lt;P&gt;C:\Program Files\cURL&amp;gt;curl -k &lt;A href="http://localhost:8088/services/collector/event"&gt;http://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk 8111111111111*********" -d "{\"event\":\"Breakfast Order\"} {\"event\":{\"coffee\":\"double cream double sugar\",\"muffin\":\"blueberry\",\"juice\":\"none\"}}" I can see the events in searchhead.&lt;/P&gt;

&lt;P&gt;My question is how to override the sourcetype and index. through curl commands? &lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 15:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268884#M51625</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-03-28T15:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268885#M51626</link>
      <description>&lt;P&gt;According to &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6P"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAE6P&lt;/A&gt; you can set special keys in your JSON next to the event to set metadata.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 16:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268885#M51626</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-28T16:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268886#M51627</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;

&lt;P&gt;Thanks for you reply.&lt;/P&gt;

&lt;P&gt;My question is how to override or set source,sourcetype through curl.Can you give me an example curl command to set or override.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 17:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268886#M51627</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-03-28T17:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268887#M51628</link>
      <description>&lt;P&gt;Here's a quote from that page:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Examples

Following are several examples of HTTP Event Collector data packets:

{
    "time": 1426279439, // epoch time
    "host": "localhost",
    "source": "datasource",
    "sourcetype": "txt",
    "index": "main",
    "event": { "hello": "world" }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your question you've only set the &lt;CODE&gt;event&lt;/CODE&gt; property.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2016 18:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268887#M51628</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-28T18:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268888#M51629</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;

&lt;P&gt;I tried below 2 command in my local windows it is not getting executed.&lt;/P&gt;

&lt;P&gt;1)curl -k &lt;A href="http://localhost:8088/services/collector/event"&gt;http://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk &lt;STRONG&gt;D87&lt;/STRONG&gt;D-F645-&lt;EM&gt;**D-A7E4-&lt;/EM&gt;&lt;EM&gt;EA&lt;/EM&gt;*AD8FC6" -d "{\"event\":\"Breakfast Order\"}{"time": 1426279439,"host": "localhost","source": "datasource","sourcetype": "hello","index": "abc","event": { "hello": "world" }"&lt;/P&gt;

&lt;P&gt;2) curl -k -H "Authorization: Splunk &lt;STRONG&gt;D87&lt;/STRONG&gt;D-F645-&lt;EM&gt;**D-A7E4-&lt;/EM&gt;&lt;EM&gt;EA&lt;/EM&gt;*AD8FC6" &lt;A href="https://localhost:8088/services/collector/event"&gt;https://localhost:8088/services/collector/event&lt;/A&gt; -d '{"event":"hello world"}{"sourcetype": "hello","index": "abc"}'&lt;/P&gt;

&lt;P&gt;Can you please correct the query if i am wrong .Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 16:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268888#M51629</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-03-29T16:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268889#M51630</link>
      <description>&lt;P&gt;Both your payloads aren't one JSON object. It should be something like &lt;CODE&gt;... -d '{"event":"hello world", "sourcetype": "hello", "index": "abc"}'&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 19:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268889#M51630</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-03-29T19:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to over ride sourcetype using curl command  for Http event collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268890#M51631</link>
      <description>&lt;P&gt;Hi Miller,&lt;/P&gt;

&lt;P&gt;Now it is working.I tried like this in windows.&lt;/P&gt;

&lt;P&gt;curl -k &lt;A href="http://localhost:8088/services/collector/event"&gt;http://localhost:8088/services/collector/event&lt;/A&gt; -H "Authorization: Splunk &lt;STRONG&gt;D87*D-F645-&lt;/STRONG&gt;D-A7E4-&lt;STRONG&gt;EA&lt;/STRONG&gt;AD8FC6" -d "{\"time\": 1437522387,\"host\": \"localhost1\",\"source\": \"testapp1\",\"sourcetype\":\"testapp1\",\"index\":\"testindexxxxxx\",\"event\": {\"message\": \"Something happened1\",\"severity\": \"WARN\"}}"&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 20:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-over-ride-sourcetype-using-curl-command-for-Http-event/m-p/268890#M51631</guid>
      <dc:creator>mprreddy51</dc:creator>
      <dc:date>2016-03-29T20:30:33Z</dc:date>
    </item>
  </channel>
</rss>

