Getting Data In

How to resolve error: Log to Splunk with Log4j2- 401 Unauthorized ?

prawinsplunk
Observer

Hi 

I am trying to integrate log4j with splunk as shown below and I am getting error - Log4j2-TF-1-AsyncLoggerConfig-1 ERROR Unable to send HTTP in appender [httptest] java.io.IOException: 401 Unauthorized.

<Http name="httptest" url="https://prd-p-xtpce.splunkcloud.com:8088/services/collector/raw">
<Property name="Authorization" value="Splunk xxxxxxx-998c-4547-beea-xxxxxx"/>
<Property name="disableCertificateValidation" value="true"/>
<JsonLayout properties="true"/>
</Http>

 

The token is valid and able to post data from postman.

 

Thanks

Labels (1)
Tags (1)
0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...