Getting Data In

The Http Event Collector (HEC) accepts but doesn't index _json event with accented characters — is this a bug?

joelroth
Engager

Hi,

I've tracked down an issue we've been having where some events being sent through our HEC haven't been indexed, even though it responds with HTTP 200 and Success (0).

I've found two workarounds for this that resolve the issue, but I'm pretty sure the HEC should either have indexed the data anyway, or responded with some sort of error instead of Success.

My tests are done in PowerShell 5.1 with en-US culture.

The following snippet is an example of this, where it'll respond with 200 OK and not index the event:

Invoke-RestMethod -Method Post -Uri "https://splunk-hec.example.com:8088/services/collector/event" -Headers @{Authorization = "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"} -ContentType "application/json" -Body @"
{
    "sourcetype":  "_json",
    "host":  "TESTHOST",
    "source":  "test:encoding",
    "event": { 
        "testtype": "charset not defined, sourcetype _json",
        "characterdata": "Têst vâlué thät has ąccents"
    }
}
"@

Also, if you specify charset=iso-8859-1 or charset=windows-1252, it also accepts and silently drops the event.

Workaround 1: Change the sourcetype to JSON (without the underscore)

# Change the sourcetype to json (no underscore)
Invoke-RestMethod -Method Post -Uri "https://splunk-hec.example.com:8088/services/collector/event" -Headers @{Authorization = "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"} -ContentType "application/json" -Body @"
{
    "sourcetype":  "json",
    "host":  "TESTHOST",
    "source":  "test:encoding",
    "event": { 
        "testtype": "charset not defined, sourcetype json",
        "characterdata": "Têst vâlué thät has ąccents"
    }
}
"@

Workaround 2: Specify the charset with IRM

Invoke-RestMethod -Method Post -Uri "https://splunk-hec.example.com:8088/services/collector/event" -Headers @{Authorization = "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"} -ContentType "application/json; charset=utf-8" -Body @"
{
    "sourcetype":  "_json",
    "host":  "TESTHOST",
    "source":  "test:encoding",
    "event": { 
        "testtype": "charset utf-8, sourcetype _json",
        "characterdata": "Têst vâlué thät has ąccents"
    }
}
"@

This is on Splunk Enterprise 7.1.2 using a heavy forwarder. Thanks!

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Introducing ITSI 5.0: Unified Visibility and Actionable Insights

Introducing ITSI 5.0: Unified Visibility and Actionable Insights Tuesday, July 21, 2026  |  10:00AM PT / ...

Inside Splunk Agent Observability: Understanding Agent Behavior, Tokens & Costs

Inside Splunk Agent Observability:Understanding Agent Behavior, Tokens & Costs Thursday, August 06, ...

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...