<?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: System Name from Syslog File in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80197#M16497</link>
    <description>&lt;P&gt;I gess that should have been a comment rather than an answer - sorry.  I'm just learning this interface.&lt;/P&gt;

&lt;P&gt;dbr&lt;/P&gt;</description>
    <pubDate>Sat, 30 Oct 2010 03:05:05 GMT</pubDate>
    <dc:creator>dbritch</dc:creator>
    <dc:date>2010-10-30T03:05:05Z</dc:date>
    <item>
      <title>System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80194#M16494</link>
      <description>&lt;P&gt;I'm using splunk to monitor /var/log on a RHEL-5.5 syslog server.  It's running rsyslog, not syslog-ng.  For some log messages, Splunk can get the name of the originating node, but on for others it simply attributes them to the log server.&lt;/P&gt;

&lt;P&gt;How can I get Splunk to use the node name in all cases?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2010 13:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80194#M16494</guid>
      <dc:creator>dbritch</dc:creator>
      <dc:date>2010-10-29T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80195#M16495</link>
      <description>&lt;P&gt;Please post some example lines from your the syslog logs as well as the directory structure used to store them, so we can determine how to best extract a host value. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2010 22:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80195#M16495</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-10-29T22:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80196#M16496</link>
      <description>&lt;P&gt;Sure - here's an example.  Everything from /var/log/secure is attributed to r00n06, my syslog and splunk server:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-10-29T19:27:29+00:00 r07n15 sshd[8158]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r07n15 sshd[8160]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r01n40 sshd[24669]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r01n40 sshd[24671]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r07n11 sshd[9969]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r07n11 sshd[9971]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r03n03 sshd[13527]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r03n03 sshd[13526]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r02n07 sshd[21721]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r02n07 sshd[21722]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r06n26 sshd[30827]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r06n26 sshd[30829]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r10n32 sshd[3410]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r10n32 sshd[3411]: Connection closed by 10.0.0.6
2010-10-29T19:27:29+00:00 r09n27 sshd[637]: Connection closed by 10.253.0.6
2010-10-29T19:27:29+00:00 r09n27 sshd[639]: Connection closed by 10.0.0.6
2010-10-29T19:27:30+00:00 r05n06 sshd[7678]: Connection closed by 10.253.0.6
2010-10-29T19:27:30+00:00 r05n06 sshd[7680]: Connection closed by 10.0.0.6
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Oct 2010 02:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80196#M16496</guid>
      <dc:creator>dbritch</dc:creator>
      <dc:date>2010-10-30T02:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80197#M16497</link>
      <description>&lt;P&gt;I gess that should have been a comment rather than an answer - sorry.  I'm just learning this interface.&lt;/P&gt;

&lt;P&gt;dbr&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2010 03:05:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80197#M16497</guid>
      <dc:creator>dbritch</dc:creator>
      <dc:date>2010-10-30T03:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80198#M16498</link>
      <description>&lt;P&gt;As you have discovered, the default hostname extraction for syslog does not work with rsyslog's datestamp format. You will need to add your own.&lt;/P&gt;

&lt;P&gt;In &lt;B&gt;transforms.conf&lt;/B&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rsyslog-host]
DEST_KEY = MetaData:Host
REGEX = ^[\d\-T\+:]+ (\S+)
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In &lt;B&gt;props.conf&lt;/B&gt; (replace &lt;CODE&gt;rsyslog&lt;/CODE&gt; below with your sourcetype name as needed):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rsyslog]
TRANSFORMS-host = rsyslog-host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Nov 2010 09:25:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80198#M16498</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-11-11T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80199#M16499</link>
      <description>&lt;P&gt;I couldn't get the above working properly with 4.1.6, so I ended up using a slightly modified transforms.conf file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rsyslog-native-host]
DEST_KEY = MetaData:Host
REGEX = [\d\-\+:.]+T[\d\-\+:.]+\s+(\S+)
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another option is to use the RSYSLOG_TraditionalForwardFormat template in your rsyslog.conf file. That will forward messages that look like standard syslog messages.&lt;/P&gt;

&lt;P&gt;The problem that neither of these solves however is that splunk is adding the timestamp and host it finds in the message header to the message.  So even with a proper regex to extract the hostname, you still end up with messages like this in your logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 24 10:09:07 localhost 2011-01-24T10:09:07.974181-08:00 xxxx snmpd[29862]: Received SNMP packet(s) from UDP: [127.0.0.1]:47553
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anyone know of a way to strip that off of the logged messages w/o jumping through too many hoops?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 02:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80199#M16499</guid>
      <dc:creator>wwwdrich</dc:creator>
      <dc:date>2011-01-25T02:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80200#M16500</link>
      <description>&lt;P&gt;I played a bit more -- if you use the RSYSLOG_TraditionalForwardFormat over TCP instead of UDP, you can use the syslog sourcetype with Splunk an it works just fine.&lt;/P&gt;

&lt;P&gt;The only problem is that it will have a "&amp;lt;##&amp;gt;" at the beginning of every message. That is the priority coming from the syslog message.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 03:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80200#M16500</guid>
      <dc:creator>wwwdrich</dc:creator>
      <dc:date>2011-01-25T03:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: System Name from Syslog File</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80201#M16501</link>
      <description>&lt;P&gt;Is it something with my browser or are the \'s (slashes) missing from the regex's above?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2014 00:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/System-Name-from-Syslog-File/m-p/80201#M16501</guid>
      <dc:creator>enno_davids</dc:creator>
      <dc:date>2014-09-23T00:42:52Z</dc:date>
    </item>
  </channel>
</rss>

