<?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: Heavy Forwarders - possible to filter dynamically? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65822#M13209</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;one approach could be the following: Create a file named filter.txt which contains all your filter strings. Next, define a new data input &amp;gt; file, for that file. Here, each line consists of a filter string:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;foo&lt;BR /&gt;
bar&lt;/CODE&gt;&lt;BR /&gt;
(make sure the whole file is beeing monitored as one event)&lt;/P&gt;

&lt;P&gt;After this you could use &lt;CODE&gt;join()&lt;/CODE&gt; to filter. E.g. like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="your_source_index" | join your_filter_field [search index="your_metaData_index" | head 1 | rex max_match=0 "(?&amp;lt;your_filter_field&amp;gt;.+)" | mvexpand your_filter_field | table your_filter_field]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I am also quite certain &lt;CODE&gt;inputlookup&lt;/CODE&gt; will work. It does. You have to add a new lookup file and lookup. Moreover you have to update that lookup file on your server in some way. A search could look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="your_source_index" | join your_filter_field [ inputlookup your_lookup | rename csv_header AS your_filter_field]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Latter solution has the back draw of getting access to the lookup file.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2013 14:31:51 GMT</pubDate>
    <dc:creator>bjoernjensen</dc:creator>
    <dc:date>2013-03-19T14:31:51Z</dc:date>
    <item>
      <title>Heavy Forwarders - possible to filter dynamically?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65821#M13208</link>
      <description>&lt;P&gt;I need to filter events when they contain an id from a defined set.&lt;/P&gt;

&lt;P&gt;I know that Heavy Forwarders can filter events based on a regex, but since my list of identifiers changes each day I will need to frequently update the configuration file containing the regex and then restart the forwarder to pick up the change. &lt;/P&gt;

&lt;P&gt;Is there a more dynamic way to filter events or is using a regex the only option? &lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 11:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65821#M13208</guid>
      <dc:creator>justjosh</dc:creator>
      <dc:date>2013-03-19T11:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Heavy Forwarders - possible to filter dynamically?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65822#M13209</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;one approach could be the following: Create a file named filter.txt which contains all your filter strings. Next, define a new data input &amp;gt; file, for that file. Here, each line consists of a filter string:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;foo&lt;BR /&gt;
bar&lt;/CODE&gt;&lt;BR /&gt;
(make sure the whole file is beeing monitored as one event)&lt;/P&gt;

&lt;P&gt;After this you could use &lt;CODE&gt;join()&lt;/CODE&gt; to filter. E.g. like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="your_source_index" | join your_filter_field [search index="your_metaData_index" | head 1 | rex max_match=0 "(?&amp;lt;your_filter_field&amp;gt;.+)" | mvexpand your_filter_field | table your_filter_field]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I am also quite certain &lt;CODE&gt;inputlookup&lt;/CODE&gt; will work. It does. You have to add a new lookup file and lookup. Moreover you have to update that lookup file on your server in some way. A search could look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index="your_source_index" | join your_filter_field [ inputlookup your_lookup | rename csv_header AS your_filter_field]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Latter solution has the back draw of getting access to the lookup file.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 14:31:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65822#M13209</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2013-03-19T14:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Heavy Forwarders - possible to filter dynamically?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65823#M13210</link>
      <description>&lt;P&gt;Thanks for the suggestion - however this is applying filtering at search time. For performance reasons I need to filter out events so they are not sent to the index.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 17:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65823#M13210</guid>
      <dc:creator>justjosh</dc:creator>
      <dc:date>2013-03-19T17:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Heavy Forwarders - possible to filter dynamically?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65824#M13211</link>
      <description>&lt;P&gt;I see.&lt;/P&gt;

&lt;P&gt;One little note: You can enable configurations changes made to transforms.conf by typing the following search in Splunk Web: "| extract reload=t"&lt;BR /&gt;
(source: documentation of transform.conf).&lt;/P&gt;

&lt;P&gt;Since you are writing:&lt;BR /&gt;
"(...) then restart the forwarder to pick up the change."&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 08:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Heavy-Forwarders-possible-to-filter-dynamically/m-p/65824#M13211</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2013-03-20T08:01:04Z</dc:date>
    </item>
  </channel>
</rss>

