<?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: No time or host in forwarded syslog messages in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52630#M10163</link>
    <description>&lt;P&gt;Just found almost the same question from 2010: &lt;A href="http://splunk-base.splunk.com/answers/8514/forward-data-to-a-syslog-server"&gt;http://splunk-base.splunk.com/answers/8514/forward-data-to-a-syslog-server&lt;/A&gt; but no answer there either.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2011 20:02:10 GMT</pubDate>
    <dc:creator>nisse</dc:creator>
    <dc:date>2011-08-03T20:02:10Z</dc:date>
    <item>
      <title>No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52627#M10160</link>
      <description>&lt;P&gt;I have a Splunk indexer (splunk-4.0.9-74233-linux-2.6-x86_64.rpm) sending cooked data to a Splunk forwarder (active_group = Forwarder, splunk-4.2.2-101277-linux-2.6-x86_64.rpm) and from there to a syslog server (it has to be that way, don't ask).&lt;/P&gt;

&lt;P&gt;This works, except that by the time the data is uncooked and fed to syslog, it's missing the priority, time stamp and host.  I don't care about the priority, but the time stamp and host are important...&lt;/P&gt;

&lt;P&gt;Indexer /opt/splunk/etc/system/local/outputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcpout:sfwd]
server = 192.168.1.120:9997
type = tcp
sendCookedData = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Forwarder /opt/splunk/etc/system/local/inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[splunktcp://:9997]
disabled = false
_SYSLOG_ROUTING = syslog_to_loghost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Forwarder /opt/splunk/etc/system/local/outputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
defaultGroup = syslog_to_loghost

[syslog:syslog_to_loghost]
disabled = false
server = 192.168.1.100:514
type = udp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the syslog loghost I get the test messages I feed to the indexer as simply:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;13&amp;gt;payload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where I'm assuming the 13 is the Splunk-applied priority.  Where is the time stamp and hostname?&lt;/P&gt;

&lt;P&gt;What obvious thing am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52627#M10160</guid>
      <dc:creator>nisse</dc:creator>
      <dc:date>2020-09-28T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52628#M10161</link>
      <description>&lt;P&gt;This seems awfully familiar to a bug I filed a while ago, SPL-50764: "Syslog output not RFC3164 compliant (missing headers)". There are some differences in that my issue is with that Splunk isn't adding host and time in the cases where these were not supplied in the incoming message either. Still, the same bug is likely to apply to your case as well. For reference I include my bug report below.&lt;/P&gt;

&lt;P&gt;When forwarding events from Splunk as syslog data to a syslogd, Splunk does not add headers like it should in order to be RFC3164 compliant, which goes against what is said on &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Forwarddatatothird-partysystems"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Forwarddatatothird-partysystems&lt;/A&gt; : "The forwarder sends RFC 3164 compliant events to a TCP/UDP-based server and port, making the payload of any non-compliant data RFC 3164 compliant. "&lt;/P&gt;

&lt;P&gt;Example setup showing the issue:&lt;BR /&gt;
Splunk instance with a raw TCP listener and a configuration to forward events received on this input as syslog data.&lt;/P&gt;

&lt;P&gt;inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcp://4711]
connection_host = ip
sourcetype = syslogtest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslogtest]
TRANSFORMS-sl = send_to_syslog
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[send_to_syslog]
REGEX = .
DEST_KEY = _SYSLOG_ROUTING
FORMAT = syslog_test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;outputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog:syslog_test]
server = 192.168.1.4:514
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In order to be RFC3164 compliant, syslog messages must include at least priority, timestamp and hostname. However, when connecting from the host "myhost" to TCP port 4711 on a Splunk server configured as in the setup above and sending a raw string such as "my test string", Splunk sends "&amp;lt;13&amp;gt;my test string" as syslog data. It should look something like "&amp;lt;13&amp;gt;Nov  9 22:01:12 myhost my test string".&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 07:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52628#M10161</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-08-03T07:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52629#M10162</link>
      <description>&lt;P&gt;That sure sounds like what I'm seeing.  Have you found a work-around?  What's the bug status?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 19:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52629#M10162</guid>
      <dc:creator>nisse</dc:creator>
      <dc:date>2011-08-03T19:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52630#M10163</link>
      <description>&lt;P&gt;Just found almost the same question from 2010: &lt;A href="http://splunk-base.splunk.com/answers/8514/forward-data-to-a-syslog-server"&gt;http://splunk-base.splunk.com/answers/8514/forward-data-to-a-syslog-server&lt;/A&gt; but no answer there either.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 20:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52630#M10163</guid>
      <dc:creator>nisse</dc:creator>
      <dc:date>2011-08-03T20:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52631#M10164</link>
      <description>&lt;P&gt;Sadly no, I haven't found a workaround. It was an issue I had in a specific scenario a limited period of time, so I haven't followed up on the bug. I haven't heard of any updates though, so my guess is it is still open and unresolved.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 20:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52631#M10164</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-08-03T20:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: No time or host in forwarded syslog messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52632#M10165</link>
      <description>&lt;P&gt;In order to receive RFC3164-compliant syslog output from Splunk, 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:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/No-time-or-host-in-forwarded-syslog-messages/m-p/52632#M10165</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2020-09-28T10:21:47Z</dc:date>
    </item>
  </channel>
</rss>

