Splunk HttpEventCollectorLogbackAppender how to set source and host?
Any setters on HttpEventCollectorLogbackAppender can be added to your logback configuration.
So to invoke setHost
, setSource
and setSourcetype
you add them to your logback configuration like this:
<appender name="SPLUNK" class="com.splunk.logging.HttpEventCollectorLogbackAppender">
<url>http://myurl:8088</url>
<host>x</host>
<source>y</source>
<sourcetype>z</sourcetype>
<token>mytoken</token>
<disableCertificateValidation>true</disableCertificateValidation>
<batch_size_count>1</batch_size_count>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%logger: %msg%n</pattern>
</layout>
</appender>