Hello, a quick note from support to explain how events are handled on HEC (on HF for instance) :
Event endpoint:
Raw endpoint:
A TA typically ships two types of config:
props.conf / transforms.conf (index-time rules) — These apply on the HF only if the sourcetype of the incoming HEC data matches stanzas in the TA. With /raw, the full parsing pipeline runs (line breaking, timestamp parsing, field transforms). With /event, only the transforms/field extraction rules apply — not line breaking.
That's also not entirely true. When you say "expects already-defined json events" one could interpret it as "you can only ingest events which are json structures using this endpoint" which is completely untrue. You can ingest any data you want, you just have to use the enpoint by means of sending appropriately formated json event containing the raw event as "event" field. See https://help.splunk.com/en/data-management/get-data-in/get-data-into-splunk-enterprise/10.4/get-data... for details.
I think that's a really helpful summary. The biggest takeaway is that /event expects already-defined JSON events, so event breaking settings aren't used, while /raw goes through the normal parsing pipeline where props.conf settings like LINE_BREAKER and SHOULD_LINEMERGE matter. Keeping that distinction in mind makes it much easier to choose the right endpoint for your data.
Yup, but the rules regarding HEC are not Kafka-addon-specific 🙂
This is not 100% true. Most is but not all.
With /event endpoint:
For /raw endpoint:
Hi @PickleRick
We use /event endpoint, our Kafka expert told me he extracts the “message” field and sends it to our HEC through the connector. Does this mean HEC receives text or json events?
He also told me messages are delimited in json, providing source and sourcetype for instance however I understand we don’t control timestamp from Splunk’s side. It’s better than raw endpoint as otherwise he would need to add delimiter on the Vector’s agent source or hardcoded for network logs for example.
Thanks.
Well, I can't know how your Kafka pipeline is configured.
But the thing is that when you send events to the HEC endpoint they look like this (quote from the docs; a syntactically erroneous one since json doesn't allow comments 😁)
{ "time": 1426279439, // epoch time "host": "localhost", "source": "random-data-generator", "sourcetype": "my_sample_data", "index": "main", "event": "Hello world!" }
All fields except "event" are optional - if there is no time supplied, Splunk will assume current time (or if sent with ?auto_extract_timestamp=true it wil be parsed from the event); for the rest of the fields Splunk will assume the defaults defined for particular HEC token. You can also send additional indexed fields as a "fields" structure.
Judging from your descripiton I'd assume that whatever the "message" field on your Kafka side is, it's getting pushed as "event" field into the HEC input. But what is in your "message" field in Kafka - that I don't know.
And if you use /services/collector/event?auto_extract_timestamp=true and _not_ provide the "time" field, Splunk will parse the timestamp out of the event regarding to the normal settings for the sourcetype. Of course if you have a reliable timestamp at the Kafka level already, you can just as well send it as "time" field and save Splunk some time parsing it again 🙂
Good points. I'd especially recommend testing /raw with multiline events before relying on it, as behavior across separate requests can be tricky. The note about /event only parsing timestamps when explicitly requested is also an important distinction.
Thanks @PickleRick for your reply, we use Kafka Connect for your information with event endpoint. The most important is HF addons in most case will apply parsing, fields extractions... however looks like timestamp will be controlled by Kafka.