<?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: Different sourcetypes for different syslog hosts? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52367#M10072</link>
    <description>&lt;P&gt;The &lt;CODE&gt;[host::hostname]&lt;/CODE&gt; will only work if it references the hostname that is seen when the event arrives in to Splunk. If the sourcetype of data is &lt;CODE&gt;syslog&lt;/CODE&gt;, there is a built-in transform that extracts and sets the &lt;CODE&gt;host&lt;/CODE&gt; field from the raw event data and is what you'll see in Splunk when searching. So, it is important to know what the &lt;CODE&gt;host&lt;/CODE&gt; value is &lt;EM&gt;prior&lt;/EM&gt; to it being transformed. You perhaps do this by disabling the transform, or using some sourcetype temporarily that does not have that transform.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2010 00:43:33 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-09-17T00:43:33Z</dc:date>
    <item>
      <title>Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52365#M10070</link>
      <description>&lt;P&gt;&lt;B&gt;Scenario:&lt;/B&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Multiple hosts send syslog data to the Splunk server on UDP port 514&lt;/LI&gt;
&lt;LI&gt;I want to be able to parse each host's data in a unique way&lt;/LI&gt;
&lt;LI&gt;Generally, I am not allowed to send syslog data on a non-standard port&lt;/LI&gt;
&lt;LI&gt;Port 514 is configured to have a sourcetype of "syslog"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;One of the hosts sending syslog data is a Barracuda Web Filter.  I would like to be able to map field names to the values in the space-delimited syslog entries that it generates.  But, it looks like this is done in transforms.conf by sourcetype, and I don't want to apply my Barracuda-specific field mappings to every host that sends syslog data on UDP port 514.&lt;/P&gt;

&lt;P&gt;Am I expected to define a special sourcetype for the Barracuda?  If so, how do I assign the sourcetype via hostname (or some other identifying characteristic) instead of just by port number?&lt;/P&gt;

&lt;P&gt;&lt;B&gt;Update:&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;I tried creating etc/system/local/props.conf with the following contents, then restarting splunkd.  It seems to have had no effect:&lt;/P&gt;

&lt;PRE&gt;
[host::barracuda-hostname.domain]
sourcetype = barracuda
&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Sep 2010 22:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52365#M10070</guid>
      <dc:creator>mileserickson</dc:creator>
      <dc:date>2010-09-16T22:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52366#M10071</link>
      <description>&lt;P&gt;I recommend to write the syslog messages to disk with syslogd or Kiwi syslog daemon, then indexing the log files,  instead of sending it straight to Splunk.&lt;/P&gt;

&lt;P&gt;This way you can easily assign different extractions to the different syslog streams based on source rather than sourcetype. There are some answers that deal with setups like this on Windows:
&lt;A href="http://answers.splunk.com/questions/5111/best-way-to-write-syslog-to-a-file-on-windows" rel="nofollow"&gt;http://answers.splunk.com/questions/5111/best-way-to-write-syslog-to-a-file-on-windows&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And a wiki entry about setting this up on Linux:
&lt;A href="http://www.splunk.com/wiki/Deploy:Best_Practice_For_Configuring_Syslog_Input" rel="nofollow"&gt;http://www.splunk.com/wiki/Deploy:Best_Practice_For_Configuring_Syslog_Input&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2010 22:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52366#M10071</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-09-16T22:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52367#M10072</link>
      <description>&lt;P&gt;The &lt;CODE&gt;[host::hostname]&lt;/CODE&gt; will only work if it references the hostname that is seen when the event arrives in to Splunk. If the sourcetype of data is &lt;CODE&gt;syslog&lt;/CODE&gt;, there is a built-in transform that extracts and sets the &lt;CODE&gt;host&lt;/CODE&gt; field from the raw event data and is what you'll see in Splunk when searching. So, it is important to know what the &lt;CODE&gt;host&lt;/CODE&gt; value is &lt;EM&gt;prior&lt;/EM&gt; to it being transformed. You perhaps do this by disabling the transform, or using some sourcetype temporarily that does not have that transform.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2010 00:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52367#M10072</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-09-17T00:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52368#M10073</link>
      <description>&lt;P&gt;As Felix mentioned, routing to different log files is a nice approach.  There are many options here, it's all about finding the one that makes the most sense in your situation.&lt;/P&gt;

&lt;P&gt;We use &lt;CODE&gt;syslog-ng&lt;/CODE&gt; running on our central splunk indexer.  We listen on a couple of different IP address (we use one IP for normal syslog stuff, and the other is used for syslog events coming from cisco network devices or from our firewall).  Sending the data on two different IP addresses allows us to use the standard syslog port and if volume someday goes up we can split out the work onto separate boxes.  From there we use a bunch of syslog-ng rules to place the content into different logs.  Some of this is done by simple syslog filtering logic, and some of it uses host filtering and regex matching.  But in the end, syslog-ng writes out basically 1 file per sourcetype.  (I say "basically", because in some cases I found it helpful to split the log files based on severity level, which then becomes part of the log name -- and then I setup a field extraction in splunk; which is nice when you want to only look at the more serious events.)  &lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;BTW, have you tried setting up field extraction directly against your host?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::barracuda-hostname.domain]
EXTRACT-fields = ^S+\S+(?&amp;lt;field1&amp;gt;\S+) ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this is the only kind of events that are coming from that host, then doing a search-time field extraction should be an efficient option.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2010 01:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52368#M10073</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-09-17T01:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52369#M10074</link>
      <description>&lt;P&gt;Very interesting.  I will try disabling the transform.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2010 01:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52369#M10074</guid>
      <dc:creator>mileserickson</dc:creator>
      <dc:date>2010-09-18T01:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52370#M10075</link>
      <description>&lt;P&gt;Yes, there is a way to do this. The important caveat here is that if you are using the "syslog" sourcetype, "host" is getting extracted from the message and forced - but this is at the same time you are also trying to force the sourcetype. Splunk doesn't know of this change yet, so you need to use the original host, sourcetype or source:&lt;/P&gt;

&lt;PRE&gt;
--props.conf--
[syslog]    &amp;lt;-- important part. host=barracuda hasn't been set yet, so use syslog or the hostname of the forwarder
TRANSFORMS-force_st_for_barracuda = force_barracuda_st

--transforms.conf--
[force_barracuda_st]  
DEST_KEY = MetaData:Sourcetype
REGEX = (barracuda-hostname.domain|bar.rac.uda.ip) &amp;lt;-- some unique string that only appears in Barracuda events
FORMAT = sourcetype::barracuda
&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2011 17:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52370#M10075</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2011-08-05T17:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Different sourcetypes for different syslog hosts?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52371#M10076</link>
      <description>&lt;P&gt;This was nice.  Just what I was looking for and gives a great way to separate Syslog input.  Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 15:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Different-sourcetypes-for-different-syslog-hosts/m-p/52371#M10076</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2016-01-05T15:21:13Z</dc:date>
    </item>
  </channel>
</rss>

