<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: forward data to a syslog server in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80414#M16574</link>
    <description>&lt;P&gt;Have you considered putting the syslog server in front of the Splunk server?&lt;/P&gt;</description>
    <pubDate>Sat, 30 Oct 2010 00:01:25 GMT</pubDate>
    <dc:creator>thepocketwade</dc:creator>
    <dc:date>2010-10-30T00:01:25Z</dc:date>
    <item>
      <title>forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80412#M16572</link>
      <description>&lt;P&gt;We're trying to forward data to a syslog server from a splunk server.
However, seems that the hostname and process id tags are missing.&lt;/P&gt;

&lt;P&gt;We've set up a central splunk server (10.10.40.9), and another splunk server to forward some data to a syslog server (10.10.40.10).&lt;/P&gt;

&lt;P&gt;Configurations used:
outputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcpout]
defaultGroup = 10.10.40.9_9997

[tcpout:10.10.40.9_9997]
server = 10.10.40.9:9997

[tcpout-server://10.10.40.9:9997]

[syslog:localhost_10514]
server = 127.0.0.1:10514
type = tcp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log]
disabled = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::*]
TRANSFORMS-routing=SYSLOG_FWD
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[SYSLOG_FWD]
REGEX = .
DEST_KEY = _SYSLOG_ROUTING
FORMAT = localhost_10514
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;example output messages (forwarded splunk output to syslog):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-10-29T17:13:05.557347+02:00 10-29-2010 17: 13:04.924 INFO  Metrics - group=per_source_thruput, series="/opt/splunk/var/log/splunk/splunkd.log", kbps=2.094271, eps=20.466667, kb=62.828125
2010-10-29T17:13:05.557347+02:00 10-29-2010 17: 13:04.924 INFO  Metrics - group=per_source_thruput, series="/opt/splunk/var/log/splunk/splunkd_stderr.log", kbps=0.000684, eps=0.033333, kb=0.020508
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;example desired output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-10-23T08:29:08.087021+02:00 VCS02 glassfish-log: [#|2010-10-23T08:29:00.584+0200|INFO|glassfish3.0.1|null|_ThreadID=29;_ThreadName=Thread-1;|Total number of available updates : 0|#]
2010-10-24T01:38:48.570726+02:00 VCS02 ntpd[14162]: synchronized to 77.226.252.14, stratum 2
2010-10-24T04:02:08.609446+02:00 VCS02 rsyslogd: [origin software="rsyslogd" swVersion="5.6.0" x-pid="26020" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Oct 2010 22:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80412#M16572</guid>
      <dc:creator>acalvo</dc:creator>
      <dc:date>2010-10-29T22:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80413#M16573</link>
      <description>&lt;P&gt;What do you want the output to look like?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2010 23:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80413#M16573</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-10-29T23:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80414#M16574</link>
      <description>&lt;P&gt;Have you considered putting the syslog server in front of the Splunk server?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2010 00:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80414#M16574</guid>
      <dc:creator>thepocketwade</dc:creator>
      <dc:date>2010-10-30T00:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80415#M16575</link>
      <description>&lt;P&gt;The message should look like a standard syslog message (while I was testing I've used the same log that Splunk produces to send it to the syslog server):&lt;/P&gt;

&lt;P&gt;$DATE $HOSTNAME $PROCESS[$PID] $MESSAGE&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2010 05:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80415#M16575</guid>
      <dc:creator>acalvo</dc:creator>
      <dc:date>2010-10-30T05:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80416#M16576</link>
      <description>&lt;P&gt;Hello acalvo,&lt;/P&gt;

&lt;P&gt;Did you find a resolution to this issue?&lt;/P&gt;

&lt;P&gt;Thanks,
Chris&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2011 04:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80416#M16576</guid>
      <dc:creator>calyope7</dc:creator>
      <dc:date>2011-04-13T04:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80417#M16577</link>
      <description>&lt;P&gt;See also similar: &lt;A href="http://splunk-base.splunk.com/answers/28438/no-time-or-host-in-forwarded-syslog-messages"&gt;http://splunk-base.splunk.com/answers/28438/no-time-or-host-in-forwarded-syslog-messages&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 20:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80417#M16577</guid>
      <dc:creator>nisse</dc:creator>
      <dc:date>2011-08-03T20:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: forward data to a syslog server</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80418#M16578</link>
      <description>&lt;P&gt;In order to receive RFC3164-compliant syslog output from Splunk (and namely, to include a time stamp in the sent event), you need to make sure to adequately set the &lt;CODE&gt;timestampformat&lt;/CODE&gt; configuration key in the &lt;CODE&gt;[syslog:&lt;GROUPNAME&gt;]&lt;/GROUPNAME&gt;&lt;/CODE&gt; stanza in outputs.conf, as per &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Outputsconf" target="_blank"&gt;outputs.conf.spec&lt;/A&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestampformat = &amp;lt;format&amp;gt;
* If specified, the formatted timestamps are added to the start of events forwarded to syslog.
* As above, this logic is only applied when the data is not syslog, or the syslogSourceType.
* The format is a strftime-style timestamp formatting string. This is the same implementation used in the 'eval' search command, splunk logging, and other places in splunkd.
    *  For example: %b %e %H:%M:%S
    * %b - Abbreviated month name (Jan, Feb, ...)
    * %e - Day of month
    * %H - Hour
    * %M - Minute
    * %s - Second
* For a more exhaustive list of the formatting specifiers, refer to the online documentation.
* Note that the string is not quoted.
* Defaults to unset, which means that no timestamp will be inserted into the front of events.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H3&gt;Test configuration (tested with Splunk 4.3 &lt;STRONG&gt;only&lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/H3&gt;

&lt;UL&gt;
&lt;LI&gt;outputs.conf:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[syslog:syslog_out]&lt;BR /&gt;
server = syslog.splunk.com:514&lt;BR /&gt;
type = tcp&lt;BR /&gt;
timestampformat = %b %e %H:%M:%S&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;props.conf:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[syslog_test]&lt;BR /&gt;
TRANSFORMS-routing = syslog_routing&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;transforms.conf:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[syslog_routing]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = _SYSLOG_ROUTING&lt;BR /&gt;
FORMAT = syslog_out&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;With this configuration, all events with sourcetype "syslog_test" will be routed to syslog host "syslog.splunk.com" on port TCP/514. The default priority code of "13" will be used, which is equivalent to "user.info", and a time stamp will be added as a prefix.&lt;/P&gt;

&lt;H3&gt;Example:&lt;/H3&gt;

&lt;UL&gt;
&lt;LI&gt;On the server hosting the Splunk instance:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[root@beefysup01 43]# cat ../sources/test.log &lt;BR /&gt;
This is a sample syslog event&lt;BR /&gt;
[root@beefysup01 43]# $SPLUNK_HOME/bin/splunk add oneshot ../sources/test.log -sourcetype syslog_test&lt;BR /&gt;
Oneshot '/home/octavio/sources/test.log' added&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;On the server recipient of the syslog forwarded messages, using netcat to receive the events:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[&lt;A href="mailto:root@syslog.splunk.com" target="_blank"&gt;root@syslog.splunk.com&lt;/A&gt;:/]# nc -kl 514&lt;BR /&gt;
&amp;lt;13&amp;gt;Jan 25 19:52:07 beefysup01 This is a sample syslog event&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I was unable to make this configuration work in versions earlier to Splunk 4.3. There are reports that this specific feature can fail in certain scenarios in 4.2.x. If you need this feature to work, please upgrade to Splunk 4.3.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:21:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/forward-data-to-a-syslog-server/m-p/80418#M16578</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2020-09-28T10:21:50Z</dc:date>
    </item>
  </channel>
</rss>

