<?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: Syslog forwarding and rewrite of host in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199184#M39442</link>
    <description>&lt;P&gt;If the sourcetype of the incoming data is set to &lt;CODE&gt;syslog&lt;/CODE&gt;, Splunk should do this by default.&lt;/P&gt;

&lt;P&gt;If it is not, you can do it yourself this way, placing &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; on the indexer:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TRANSFORMS-sethost = set-host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set-host]
DEST_KEY = MetaData:Host
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?)\.\w+\s+)*\[?(\w[\w\.\-]{2,})\]?\s
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW, I didn't write that regular expression, I copied it from the &lt;CODE&gt;etc/system/default/transforms.conf&lt;/CODE&gt;, so it is the same one that Splunk uses for syslog.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2014 19:48:20 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2014-01-09T19:48:20Z</dc:date>
    <item>
      <title>Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199183#M39441</link>
      <description>&lt;P&gt;I am forwarding events from a group of servers to an Indexer by way of a Splunk light forwarder.    I have forwarding turned on the Indexer to send these events to a syslog server, however when the syslog server receives the forwarded Splunk data from the Indexer its shows the host as the indexer name not the original host    &lt;/P&gt;

&lt;P&gt;Light Forwarders (eventdata) -&amp;gt; Indexer -&amp;gt; Syslog&lt;/P&gt;

&lt;P&gt;What is the quickest way to rewrite the source host name in the syslog so that it correctly show the original host?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199183#M39441</guid>
      <dc:creator>approachct</dc:creator>
      <dc:date>2014-01-09T19:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199184#M39442</link>
      <description>&lt;P&gt;If the sourcetype of the incoming data is set to &lt;CODE&gt;syslog&lt;/CODE&gt;, Splunk should do this by default.&lt;/P&gt;

&lt;P&gt;If it is not, you can do it yourself this way, placing &lt;CODE&gt;props.conf&lt;/CODE&gt; and &lt;CODE&gt;transforms.conf&lt;/CODE&gt; on the indexer:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TRANSFORMS-sethost = set-host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set-host]
DEST_KEY = MetaData:Host
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?)\.\w+\s+)*\[?(\w[\w\.\-]{2,})\]?\s
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BTW, I didn't write that regular expression, I copied it from the &lt;CODE&gt;etc/system/default/transforms.conf&lt;/CODE&gt;, so it is the same one that Splunk uses for syslog.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 19:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199184#M39442</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-01-09T19:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199185#M39443</link>
      <description>&lt;P&gt;How should the outputs.conf be configured with props.conf and transforms.conf configured as above?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2014 15:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199185#M39443</guid>
      <dc:creator>yungro</dc:creator>
      <dc:date>2014-01-21T15:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199186#M39444</link>
      <description>&lt;P&gt;Lisa, I think you misunderstood the question. The question wasn't about setting the host field correctly in splunk, but about changing the syslog header when forwarding the data. I have the same problem and haven't yet found a solution...&lt;BR /&gt;
...let me make an example.&lt;/P&gt;

&lt;P&gt;Setting:&lt;BR /&gt;
Maschine Forwarder ---&amp;gt; Indexer --&amp;gt; syslog host&lt;BR /&gt;
Log / Event (1) (2) (3)&lt;/P&gt;

&lt;P&gt;During its travel from (1) to (3), a log line looks as follows:&lt;BR /&gt;
(1) Oct 30 08:25:43 xxxx yyyy.zzzz aaaa&lt;BR /&gt;
(2) Oct 30 08:25:43 xxxx yyyy.zzzz aaaa&lt;BR /&gt;
_time=Oct 30 08:25:43 host=xxxx sourcetype=syslog ...&lt;BR /&gt;
(3) Oct 30 08:25:45 mmm nnn.ooo Oct 30 08:25:43 xxxx yyyy.zzzz aaaa&lt;/P&gt;

&lt;P&gt;xxxx: original host&lt;BR /&gt;
mmm: Indexer hostname&lt;BR /&gt;
yyyy.zzzz: original facility.priority&lt;BR /&gt;
nnn.ooo: facility.priority set in outputs.conf of mmm for syslog forwarding&lt;BR /&gt;
aaaa: original message&lt;/P&gt;

&lt;P&gt;This means that all data being received by the syslog host seems to be originating from the Splunk Indexer and has the same facility.priority (if one is not using different stanzas in outputs.conf, e.g. for different source types).&lt;BR /&gt;
In the case of (1) being syslog, the syslog host can parse the message and take the original hostname (xxxx) and facility.priority (yyyy.zzzz) out of the message.&lt;BR /&gt;
But if (1) is not containing a hostname, the original host cannot be induced from (3). For this it would be needed that the Splunk Indexer, when forwarding data by syslog, adds a syslog header which contains the value of the host field (per event) instead of its own hostname.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2014 09:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199186#M39444</guid>
      <dc:creator>dvb</dc:creator>
      <dc:date>2014-10-31T09:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199187#M39445</link>
      <description>&lt;P&gt;Using the option syslogSourceType you can tell Splunk which source types are already in syslog format. For these source types the syslog header will then contain the hostname of the original log (and not the hostname of the intermediate forwarder). Unfortunately the option doesn't accept regex, so multiple output stanzas are needed (see example) if your syslog source types have no common subset. Further it seems that this option has no influence on facility.priority, i.e. facility.priority will always be user.notice instead of the original one.&lt;BR /&gt;
--&amp;gt; I filed an enhancement request to change syslogSourceType to accept regex.&lt;/P&gt;

&lt;P&gt;===inputs.conf===&lt;BR /&gt;
[splunktcp-ssl://9997]&lt;BR /&gt;
connection_host = ip&lt;BR /&gt;
_SYSLOG_ROUTING = tacLOG_1515a&lt;/P&gt;

&lt;P&gt;[monitor:///data/Logweiche/mmm]&lt;BR /&gt;
index=nnn&lt;BR /&gt;
sourcetype=ooo&lt;BR /&gt;
_SYSLOG_ROUTING = tacLOG_1515a&lt;/P&gt;

&lt;P&gt;[monitor:///data/Logweiche/xxx]&lt;BR /&gt;
index=yyy&lt;BR /&gt;
sourcetype=zzz&lt;BR /&gt;
_SYSLOG_ROUTING = tacLOG_1515b&lt;/P&gt;

&lt;P&gt;===outputs.conf===&lt;BR /&gt;
[syslog]&lt;BR /&gt;
[syslog:tacLOG_1515a]&lt;BR /&gt;
type = tcp &lt;/P&gt;

&lt;H1&gt;set no additional syslog header for sourcetype ooo*&lt;/H1&gt;

&lt;P&gt;syslogSourceType = ooo&lt;/P&gt;

&lt;P&gt;[syslog:tacLOG_1515b]&lt;BR /&gt;
type = tcp&lt;/P&gt;

&lt;H1&gt;no additional header for sourcetype zzz&lt;/H1&gt;

&lt;P&gt;syslogSourceType = sourcetype::zzz&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199187#M39445</guid>
      <dc:creator>dvb</dc:creator>
      <dc:date>2020-09-28T18:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199188#M39446</link>
      <description>&lt;P&gt;Hi, yo you have any information, if this Enhancement Request was implemented?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199188#M39446</guid>
      <dc:creator>goelli</dc:creator>
      <dc:date>2019-08-19T12:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199189#M39447</link>
      <description>&lt;P&gt;No, I don't have any information.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 06:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199189#M39447</guid>
      <dc:creator>dvb</dc:creator>
      <dc:date>2019-08-21T06:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Syslog forwarding and rewrite of host</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199190#M39448</link>
      <description>&lt;P&gt;I opened a case and it's confirmed, that the ER was not implemented by now. Our need is now added to ER SPL-175134, but no big hope for having this implemented soon.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 09:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Syslog-forwarding-and-rewrite-of-host/m-p/199190#M39448</guid>
      <dc:creator>goelli</dc:creator>
      <dc:date>2019-08-21T09:12:10Z</dc:date>
    </item>
  </channel>
</rss>

