When you send data to the HTTP Event Collector (HEC) in Splunk without specifying a sourcetype, Splunk will use the default settings configured for the HEC token. Here’s what happens:

1. Default Behavior:

2. Automatic Parsing with _json Sourcetype:

Example: Payload sent without sourcetype: json { "event": { "host": "test-server", "plugin": "cpu", "values": [25.5] } } Splunk will typically interpret this with sourcetype="_json" and extract fields like host, plugin, and values.

3. HEC Token Default Settings:

4. Indexing Without Parsing:

Best Practice: Specify the sourcetype Explicitly

To ensure that the data is parsed correctly and fields are extracted as expected, it is a good practice to explicitly specify the sourcetype in the payload or configure it in the HEC token settings.

Example of Specifying sourcetype in Payload: json { "sourcetype": "collectd_json", "event": { "host": "test-server", "plugin": "cpu", "values": [25.5] } }

Troubleshooting Tips:

This should help you understand where the data goes and how it is handled when the sourcetype is not explicitly defined. Let me know if you need more details or specific examples!