<?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: Filter events before indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52012#M9986</link>
    <description>&lt;P&gt;Ayn's regex will work if you add the quotes to it, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = risk_rating=\"([0-6]|7[0-4])\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Jan 2015 19:25:59 GMT</pubDate>
    <dc:creator>richard_g_curry</dc:creator>
    <dc:date>2015-01-08T19:25:59Z</dc:date>
    <item>
      <title>Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52006#M9980</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm consulting the documentation regarding filtering events before they get indexed but i have issue to understand how i could do that.&lt;/P&gt;

&lt;P&gt;I got events coming from 1 IP, and i don't want to index the events where the field "risk_rating" is lower than 75.&lt;/P&gt;

&lt;P&gt;i really don't know how to do that with props.conf and transforms.conf&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt;&lt;BR /&gt;
    [host::10.6.75.16]&lt;BR /&gt;
    TRANSFORMS-null= setnull&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Tranforms.conf&lt;/STRONG&gt;&lt;BR /&gt;
    [setnull]&lt;BR /&gt;
    REGEX=???? /&lt;EM&gt;did i have to use this field&lt;/EM&gt;/&lt;BR /&gt;
    DEST_KEY=queue&lt;BR /&gt;
    FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;How could i say all the values under 75 for the field "risk_rating" isn't indexed under the transforms file ?&lt;BR /&gt;
It seems quit simple but i really don't get it ...&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2012 14:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52006#M9980</guid>
      <dc:creator>rbw78</dc:creator>
      <dc:date>2012-12-03T14:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52007#M9981</link>
      <description>&lt;P&gt;It's not really simple unfortunately because the filter strings that are used for event filtering can't be used for mathematical comparisons like that. The only way to filter events is by constructing a regular expression that matches your unwanted events - or vice versa, a regular expression that "whitelists" events that should not be filtered.&lt;/P&gt;

&lt;P&gt;If you have something like the text "&lt;CODE&gt;risk_rating=50&lt;/CODE&gt;" or similar and you want to grab only events where this rating is below 75, it CAN be done with a regex - it doesn't look very pretty but it works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = risk_rating=([0-6]|7[0-4])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2012 14:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52007#M9981</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-03T14:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52008#M9982</link>
      <description>&lt;P&gt;Ok thanks for the feedback.&lt;/P&gt;

&lt;P&gt;Well, the possible values i want to exclude for this field goes from 0 to 74.&lt;BR /&gt;
If i add a regex for this 75 possibilities, is there a performance impact for indexing the coming data ?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2012 14:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52008#M9982</guid>
      <dc:creator>rbw78</dc:creator>
      <dc:date>2012-12-03T14:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52009#M9983</link>
      <description>&lt;P&gt;The regex I showed you does this. There's no need to create 75 different matching groups, because just two will do: one for when risk_rating starts with anything from 0 to 6, and one for when it starts with 7 and is followed by anything from 0 to 4.&lt;/P&gt;

&lt;P&gt;There's a theoretical performance impact, but in fairness there's lots of stuff going on when indexing data so I think that impact is neglectable.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:05:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52009#M9983</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-03T15:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52010#M9984</link>
      <description>&lt;P&gt;Thanks for the feedback Ayn.&lt;/P&gt;

&lt;P&gt;Well, i tried the REGEX you told me but it dosen't seems to work, i still have risk_rating events lower than 75 indexed.&lt;/P&gt;

&lt;P&gt;This field look like this in my events&lt;/P&gt;

&lt;P&gt;risk_rating="00"&lt;/P&gt;

&lt;P&gt;I've only changed the REGEX value into the transforms.conf mentioned above.&lt;BR /&gt;
It should be enough right ?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2012 13:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52010#M9984</guid>
      <dc:creator>rbw78</dc:creator>
      <dc:date>2012-12-04T13:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52011#M9985</link>
      <description>&lt;P&gt;What does the regex you're using now look like? My sample regex was assuming that the equals sign was directly followed by the digits, so if you've used mine straight away that won't work - you'll have to add the quotes too.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2012 17:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52011#M9985</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-04T17:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52012#M9986</link>
      <description>&lt;P&gt;Ayn's regex will work if you add the quotes to it, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = risk_rating=\"([0-6]|7[0-4])\"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jan 2015 19:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-before-indexing/m-p/52012#M9986</guid>
      <dc:creator>richard_g_curry</dc:creator>
      <dc:date>2015-01-08T19:25:59Z</dc:date>
    </item>
  </channel>
</rss>

