Splunk Enterprise

HTTP EVENT Collector - HttpAppender - how to add hostname

dsvasani
New Member

Dear All

 

I am new to Splunk, and we are using log4j2 configuration file with HttpAppender to send logs , but I am not able to add Host name.

 

This is what I use:

 

 

 

 

<Http name="Splunk-New" url="http://host:8088/services/collector/raw">
                        <Property name="Authorization" value="Splunk token"></Property>
                        <Property name="Host" value="${hostName}"></Property>
                        <PatternLayout pattern="%-5p %d [%t] [event: %X{correlationId}] %c: %m%n"></PatternLayout>
                </Http>

 

 

 

 

Labels (1)
0 Karma

rupkumar4sec
Path Finder

${hostName} variable used in below line should provide required value for Host. 

<Property name="Host" value="${hostName}"></Property>

 

Reference from Log4j documentation:
 "The default map is pre-populated with a value for "hostName" that is the current system's host name or IP address"

https://logging.apache.org/log4j/2.x/manual/configuration.html 

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...