title: Configure log4j to send its logs to Splunk?
body: <p>I need to send my log4j logs to Splunk. I found several solutions:</p>
  
  <ol>
  <li>To use REST API (e.g. <code>curl -k -u admin:changeme -d "name=/tmp/myfile.log" -d "sourcetype=syslog" https://localhost:8089/servicesNS/admin/search/data/inputs/monitor</code>)</li>
  <li>Install Splunk Universal Forwarder</li>
  <li><p>Use log4j appender
  such as:</p>
  
  <h3>Syslog appender</h3>
  
  <p>log4j.appender.splunk=org.apache.log4j.net.SyslogAppender
  log4j.appender.splunk.SyslogHost=localhost:8089
  log4j.appender.splunk.layout=org.apache.log4j.PatternLayout
  log4j.appender.splunk.facility=LOCAL2
  log4j.appender.splunk.layout.ConversionPattern=[%p] %t: %m%n</p></li>
  </ol>
  
  <p>but it seems to me that 3rd solution wouldn't work if splunk server and log are located on separate machines.</p>
  
  <p>2nd solution requires to install additional software</p>
  
  <p>Can anyone propose any other solution? </p>
  
  <p>PS I tried to use opensource java libs. But it didn't give a result. </p>