<?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: Does the HTTP Event Collector API support events with arbitrary metadata? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216095#M42516</link>
    <description>&lt;P&gt;Thank you. Is there any consideration of this feature in Splunk's roadmap?&lt;/P&gt;

&lt;P&gt;We are trying to build something generic, that works with docker and helps us get logs to Splunk. We want this to be something that &lt;STRONG&gt;"forwards and tags"&lt;/STRONG&gt; logs, rather than something that &lt;STRONG&gt;"wraps logs in an envelope with tags"&lt;/STRONG&gt; or &lt;STRONG&gt;"parses then merges with tags"&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Forwarding is attractive because it means developers that use our log forwarder can expect that if they write something to STDOUT, it will go to Splunk that way. This means developers can be in control of which sourcetype they use. It means our component is of lower complexity, and we don't have to explain how we rewrite log events.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Aug 2016 02:10:02 GMT</pubDate>
    <dc:creator>yeungdarea</dc:creator>
    <dc:date>2016-08-15T02:10:02Z</dc:date>
    <item>
      <title>Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216092#M42513</link>
      <description>&lt;P&gt;According to the "&lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6P#meta"&gt;Format events for HTTP Event Collector&lt;/A&gt;" document, I can send &lt;CODE&gt;time&lt;/CODE&gt;, &lt;CODE&gt;host&lt;/CODE&gt;, &lt;CODE&gt;source&lt;/CODE&gt;, &lt;CODE&gt;sourcetype&lt;/CODE&gt; and &lt;CODE&gt;index&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;I would like to send additional event metadata. Is this possible?&lt;/P&gt;

&lt;P&gt;Given I'm running Splunk 6.4.2 with an HTTP Event Collector,&lt;BR /&gt;
When I send an event with a metadata key called &lt;CODE&gt;foo&lt;/CODE&gt; with the value &lt;CODE&gt;bar&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -k -vv -H "Content-Type: application/json" -H "Authorization: Splunk XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" &lt;A href="http://splunk:8088/services/collector/event" target="test_blank"&gt;http://splunk:8088/services/collector/event&lt;/A&gt; -d '{"event": "hello world", "foo": "bar"}'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, I get this response:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt; HTTP/1.1 400 Bad Request
&amp;lt; Date: Tue, 09 Aug 2016 05:26:47 GMT
&amp;lt; Content-Type: application/json; charset=UTF-8
&amp;lt; X-Content-Type-Options: nosniff
&amp;lt; Content-Length: 27
&amp;lt; Connection: Keep-Alive
&amp;lt; X-Frame-Options: SAMEORIGIN
&amp;lt; Server: Splunkd
&amp;lt; 
* Connection #0 to host 172.25.0.3 left intact
{"text":"No data","code":5}%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was hoping for a 200 OK and to see my event with the "foo" metadata.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 05:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216092#M42513</guid>
      <dc:creator>yeungdarea</dc:creator>
      <dc:date>2016-08-09T05:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216093#M42514</link>
      <description>&lt;P&gt;I would also like to be able to attach meta-data to log events sent via the HEC.&lt;/P&gt;

&lt;P&gt;My use case is logs from Docker containers.  I want to pass through log-lines from each container, intact, and optionally specify a "source type" to tell Splunk how to parse them (which rules out transforming the lines on their way to Splunk).  But, I also want to capture metadata such as container-name, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "time": ...,
  "source": ...,
  "event": "192.168.0.1 fnord:/api/blah - 42.3 admin yup garbage",
  "sourcetype": "my-custom-reverse-proxy-log-format",
  "meta": {
    "stack": "myapp-demo",
    "container": {
      "name": "revproxy",
      "id": "4b6771ca97e3"
    }
  }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 23:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216093#M42514</guid>
      <dc:creator>mdub_rea</dc:creator>
      <dc:date>2016-08-09T23:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216094#M42515</link>
      <description>&lt;P&gt;You can't send additional metadata, but you can certainly include your metadata as json within the event.  You also should look at using the new raw endpoint:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTinput#services.2Fcollector.2Fraw"&gt;http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTinput#services.2Fcollector.2Fraw&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;"Send raw data directly to the HTTP Event Collector. This endpoint allows one or more raw events to be sent in a single request. All events are parsed using the standard Splunk software pipeline, which includes breaking rules and timestamp extraction."&lt;/P&gt;

&lt;P&gt;Since you can now apply props to the data you should be able to create extractions that add indexed fields.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 02:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216094#M42515</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-08-10T02:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216095#M42516</link>
      <description>&lt;P&gt;Thank you. Is there any consideration of this feature in Splunk's roadmap?&lt;/P&gt;

&lt;P&gt;We are trying to build something generic, that works with docker and helps us get logs to Splunk. We want this to be something that &lt;STRONG&gt;"forwards and tags"&lt;/STRONG&gt; logs, rather than something that &lt;STRONG&gt;"wraps logs in an envelope with tags"&lt;/STRONG&gt; or &lt;STRONG&gt;"parses then merges with tags"&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Forwarding is attractive because it means developers that use our log forwarder can expect that if they write something to STDOUT, it will go to Splunk that way. This means developers can be in control of which sourcetype they use. It means our component is of lower complexity, and we don't have to explain how we rewrite log events.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 02:10:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216095#M42516</guid>
      <dc:creator>yeungdarea</dc:creator>
      <dc:date>2016-08-15T02:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216096#M42517</link>
      <description>&lt;P&gt;We are evaluating inserting KV pairs in the &lt;CODE&gt;source&lt;/CODE&gt; field, and providing Splunk with a configuration snippet that allows us to extract these fields at search time.&lt;/P&gt;

&lt;P&gt;It would be much nicer if there was a way to do this in the HEC API, so we didn't need to configure anything.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 02:12:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216096#M42517</guid>
      <dc:creator>yeungdarea</dc:creator>
      <dc:date>2016-08-15T02:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216097#M42518</link>
      <description>&lt;P&gt;Take a look at these two links, if you haven't seem them already.  They cover the Splunk docker driver, which uses the HEC.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.docker.com/engine/admin/logging/splunk/"&gt;https://docs.docker.com/engine/admin/logging/splunk/&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://blogs.splunk.com/2015/12/16/splunk-logging-driver-for-docker/"&gt;http://blogs.splunk.com/2015/12/16/splunk-logging-driver-for-docker/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You'll see it works nicely with Docker, but does wrap the events as you say.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 03:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216097#M42518</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-08-15T03:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216098#M42519</link>
      <description>&lt;P&gt;@yeungdarea today HEC will not allow you to pass arbitrary metadata fields. There is something coming soon in HEC which will allow this and should ultimately make it to the Docker driver. For the Docker driver, the only option today is to add labels which will show up in the JSON as you observed, or you can explore extracting fields other ways.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 05:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216098#M42519</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-08-16T05:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216099#M42520</link>
      <description>&lt;P&gt;We are looking forward to trying out this new feature. Would love to hear more details.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 07:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216099#M42520</guid>
      <dc:creator>yeungdarea</dc:creator>
      <dc:date>2016-08-16T07:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Does the HTTP Event Collector API support events with arbitrary metadata?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216100#M42521</link>
      <description>&lt;P&gt;Great! Email me and I can tell you more: &lt;A href="mailto:gblock@splunk.com"&gt;gblock@splunk.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 18:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-the-HTTP-Event-Collector-API-support-events-with-arbitrary/m-p/216100#M42521</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-08-16T18:31:48Z</dc:date>
    </item>
  </channel>
</rss>

