<?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: Filtering syslog inputs in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45964#M8638</link>
    <description>&lt;P&gt;I'm a bit distrustful of the capital S in Source::udp://514.
Also, I thought events should have udp:514 as their source, without slashes.  You should check in the search UI.  &lt;/P&gt;

&lt;P&gt;We may default to using _raw as the source key, but I've always set it explicitly.  SOURCE_KEY=_raw in the transform.&lt;/P&gt;

&lt;P&gt;I'm pretty baffled about the \n.  Do your single syslog events actually have linebreaks in them?  I would bet they don't.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2011 02:00:23 GMT</pubDate>
    <dc:creator>jrodman</dc:creator>
    <dc:date>2011-02-17T02:00:23Z</dc:date>
    <item>
      <title>Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45963#M8637</link>
      <description>&lt;P&gt;Trying to filter syslog input from ESX hosts, without impacting any other syslog  inputs.&lt;BR /&gt;
The ESX host names are 192.168.105.*&lt;BR /&gt;
The only events we want to see from them will contain vmhba.&lt;BR /&gt;
I have tried to follow the model at &lt;A href="http://www.splunk.com/base/Documentation/4.1.6/Admin/Routeandfilterdata#Discard_specific_events_and_keep_the_rest" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/Admin/Routeandfilterdata#Discard_specific_events_and_keep_the_rest&lt;/A&gt;.&lt;BR /&gt;
The regex works in a PCRE regex tester, but does not seem to be working in Splunk.&lt;BR /&gt;
Is the regex wrong, or do I have a different problem? &lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::udp:514]
MAX_TIMESTAMP_LOOKAHEAD = 32
SHOULD_LINEMERGE = False
TRANSFORMS-set=cisco_asa,nullQ=SyslogNullFilter 
#TZ = GMT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [SyslogNullFilter]
  REGEX = ^.{16}192\.168\.105\.(?!.*vmhba)
    also tried:
    REGEX = (?m)^.{16}192\.168\.105\.(?!.*vmhba)
    REGEX = (?:^.{16}192\.168\.105\.(?!.*vmhba))
  SOURCE_KEY=_raw
  DEST_KEY=queue 
  FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried MW's suggestion "keep specific events while discarding the rest." It filtered all events from 192.168.105.*.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::udp:514]
MAX_TIMESTAMP_LOOKAHEAD = 32
SHOULD_LINEMERGE = False
TRANSFORMS-set=setkeep,setnull,setcisco_asa
#TZ = GMT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setcisco_asa]
DEST_KEY = MetaData:Sourcetype
REGEX = (%ASA)
FORMAT = sourcetype::cisco_asa

[setnull]
REGEX = .
SOURCE_KEY=_raw
DEST_KEY=queue 
FORMAT = nullQueue 

[setkeep]
REGEX = ^.{16}192\.168\.105\..*vmhba|^(?!.{16}192\.168\.105\.)
SOURCE_KEY=_raw
DEST_KEY=queue 
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Feb 2011 01:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45963#M8637</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-17T01:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45964#M8638</link>
      <description>&lt;P&gt;I'm a bit distrustful of the capital S in Source::udp://514.
Also, I thought events should have udp:514 as their source, without slashes.  You should check in the search UI.  &lt;/P&gt;

&lt;P&gt;We may default to using _raw as the source key, but I've always set it explicitly.  SOURCE_KEY=_raw in the transform.&lt;/P&gt;

&lt;P&gt;I'm pretty baffled about the \n.  Do your single syslog events actually have linebreaks in them?  I would bet they don't.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 02:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45964#M8638</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2011-02-17T02:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45965#M8639</link>
      <description>&lt;P&gt;I'm just using \n to anchor to the beginning of the event -- I only want the IP address if it begins at position 17.&lt;BR /&gt;&lt;BR /&gt;
I don't understand the comment about source key.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 03:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45965#M8639</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-17T03:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45966#M8640</link>
      <description>&lt;P&gt;UDP syslog events aren't split by newlines, but by packets, so there's no newline even on the wire.  In splunk, we cut on newlines in the LINE_BREAKER, so they're typically still not available except for multiline events.  Use the ^ character for the beginning of your event.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 03:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45966#M8640</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2011-02-17T03:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45967#M8641</link>
      <description>&lt;P&gt;^ did not work in the tester, but I tried it in Splunk anyway.&lt;BR /&gt;&lt;BR /&gt;
Did not work.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 04:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45967#M8641</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-17T04:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45968#M8642</link>
      <description>&lt;P&gt;When working in the tester (^.{16}) returns only the first 16 characters of the entire test block -- not the first 16 of each line.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 04:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45968#M8642</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-17T04:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45969#M8643</link>
      <description>&lt;P&gt;Okay, but splunk isn't applying the regex to the whole file, it's applying it to each event.  In fact, from splunk's perspective there isn't a file at all, because the data is arriving as udp packets.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 05:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45969#M8643</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2011-02-17T05:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45970#M8644</link>
      <description>&lt;P&gt;That explains why the tester only gets the first occurrence if the partial IP is in the first line of the test block, but not why it doesn't work in Splunk.   &lt;/P&gt;

&lt;P&gt;btw, case of "source::udp://514" has been fixed&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 05:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45970#M8644</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-17T05:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45971#M8645</link>
      <description>&lt;P&gt;First, I agree with jrodman that there are some syntax issues.&lt;/P&gt;

&lt;P&gt;Also, it sounds like you actually want to &lt;EM&gt;keep&lt;/EM&gt; specific events while discarding the rest, rather than discarding specific events and keeping everything else, as the link you provided leads me to.  Do you maybe need this link?  &lt;A href="http://www.splunk.com/base/Documentation/4.1.6/Admin/Routeandfilterdata#Keep_specific_events_and_discard_the_rest" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/Admin/Routeandfilterdata#Keep_specific_events_and_discard_the_rest&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2011 10:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45971#M8645</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-02-17T10:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45972#M8646</link>
      <description>&lt;P&gt;If I were only concerned with syslog from the VM hosts you wold be correct. However, there are a lot of syslog inputs for switches, routers, etc. that I want to leave untouched. Obviously there is some sort of error in the regex. It seems that using the caret to anchor to the beginning of the event as Josh suggested should be the answer, but I can't get it to work outside of the tester.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 06:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45972#M8646</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-18T06:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45973#M8647</link>
      <description>&lt;P&gt;Ah, I'm following now.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2011 11:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45973#M8647</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-02-18T11:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45974#M8648</link>
      <description>&lt;P&gt;Edited to reflect changes recommended by jrodman.&lt;BR /&gt;&lt;BR /&gt;
Regex works in tester, but not in Splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2011 01:23:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45974#M8648</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-23T01:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45975#M8649</link>
      <description>&lt;P&gt;RE udp:..514 -- You are correct. In the search UI the source does not show slashes. However, the syntax is inline with that given in the manual: &lt;A href="http://www.splunk.com/base/Documentation/4.1.6/Admin/Inputsconf"&gt;http://www.splunk.com/base/Documentation/4.1.6/Admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2011 01:37:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45975#M8649</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-23T01:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45976#M8650</link>
      <description>&lt;P&gt;That's the documentation for inputs.conf.  Props.conf syntax is source::the_source_string where your source string is udp:514.  Maybe we should explicitly document how the source string is formatted for these events, but I prefer simply checking search results.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45976#M8650</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2020-09-28T09:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45977#M8651</link>
      <description>&lt;P&gt;OK, got it -- again -- there is not a direct relationship between inputs.conf and props.conf. Found a correctly formatted entry for udp:514 already in props, already using a transform. I added my transform to it. Are multiple transforms for the same source allowable? See above edit.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2011 03:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45977#M8651</guid>
      <dc:creator>rgcox1</dc:creator>
      <dc:date>2011-02-23T03:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45978#M8652</link>
      <description>&lt;P&gt;TRANSFORMS-foo=a,b,c,d says to use all four of those.  Then TRANSFORMS-bar=e says to use that one too.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2011 04:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45978#M8652</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2011-02-24T04:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45979#M8653</link>
      <description>&lt;P&gt;Was this ever solved?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 14:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45979#M8653</guid>
      <dc:creator>grantsales</dc:creator>
      <dc:date>2015-04-28T14:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering syslog inputs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45980#M8654</link>
      <description>&lt;P&gt;You might want to use Fluentd to filter logs at the edge. Here's a full configuration that might work for you (it assumes that you are listening to syslog over UDP at port 5140.&lt;/P&gt;

&lt;P&gt;# collecting syslog&lt;BR /&gt;
&amp;lt;source&amp;gt;&lt;BR /&gt;
  @type syslog&lt;BR /&gt;
  port 5140&lt;BR /&gt;
  tag system&lt;BR /&gt;
&amp;lt;/source&amp;gt;&lt;/P&gt;

&lt;P&gt;# adding hostname&lt;BR /&gt;
&amp;lt;filter system.**&amp;gt;&lt;BR /&gt;
  @type record_transform&lt;BR /&gt;
  &amp;lt;record&amp;gt;&lt;BR /&gt;
    hostname "#{Socket.gethostname}"&lt;BR /&gt;
  &amp;lt;/record&amp;gt;&lt;/P&gt;

&lt;P&gt;# filtering based on the given condition&lt;BR /&gt;
&amp;lt;/filter&amp;gt;&lt;BR /&gt;
&amp;lt;filter system.**&amp;gt;&lt;BR /&gt;
  @type grep &lt;BR /&gt;
  &amp;lt;regexp&amp;gt;&lt;BR /&gt;
    key hostname&lt;BR /&gt;
    pattern ^192.168.105.&lt;BR /&gt;
  &amp;lt;/regexp&amp;gt;&lt;BR /&gt;
  &amp;lt;regexp&amp;gt;&lt;BR /&gt;
    key message&lt;BR /&gt;
    pattern vmhba&lt;BR /&gt;
  &amp;lt;/regexp&amp;gt;&lt;BR /&gt;
&amp;lt;/filter&amp;gt;&lt;/P&gt;

&lt;P&gt;This is just one example of the type of "smart filtering/routing" Fluentd can bring to the edge. For example, you can configure Fluentd so that Splunk only sees error/warn messages (to save on the bandwidth) like this:&lt;/P&gt;

&lt;P&gt;&amp;lt;source&amp;gt;&lt;BR /&gt;
  @type syslog&lt;BR /&gt;
  port 5140&lt;BR /&gt;
  tag splunk&lt;BR /&gt;
&amp;lt;/source&amp;gt;&lt;BR /&gt;
&amp;lt;match splunk.&lt;EM&gt;.{error,warn}&amp;gt;&lt;BR /&gt;
  @type splunk&lt;BR /&gt;
  # other config parameters&lt;BR /&gt;
&amp;lt;/match&amp;gt;&lt;BR /&gt;
&amp;lt;match splunk.&lt;/EM&gt;*&amp;gt;&lt;BR /&gt;
  @type s3&lt;BR /&gt;
  # archive the rest in Amazon S3, say, for cheaper storage&lt;BR /&gt;
&amp;lt;/match&amp;gt;&lt;/P&gt;

&lt;P&gt;Again, if you are looking to use Fluentd in a production environment, check out &lt;STRONG&gt;&lt;A href="https://fluentd.treasuredata.com/splunk-optimize/"&gt;Fluentd Enterprise by Treasure Data&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 08:06:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filtering-syslog-inputs/m-p/45980#M8654</guid>
      <dc:creator>kiyototamura</dc:creator>
      <dc:date>2017-07-24T08:06:12Z</dc:date>
    </item>
  </channel>
</rss>

