<?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 and use SEDCMD? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120008#M24971</link>
    <description>&lt;P&gt;Sample events?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2013 14:19:20 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2013-10-29T14:19:20Z</dc:date>
    <item>
      <title>Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120007#M24970</link>
      <description>&lt;P&gt;I am trying to filter events and then apply a sed script to only the events that I want to keep. I want to discard all events that do not contain Keyword1 or Keyword2. I have been able to filter events and use the &lt;CODE&gt;SEDCMD&lt;/CODE&gt;, but I have been unsuccessful in using them together. Below is my configuration. How can I make this work? In addition, my regex may be incorrect. I'm not sure how to apply a NOT operator.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/path/to/file]
TRANSFORMS-set = setnull
SEDCMD-keep = s/this/that/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = (?!(Keyword1|Keyword2))
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; In the end I used the above solution with regex help provided by @ShaneNewman. As mentioned below, the solution provided by @kristian.kolb works perfectly as well, but I opted for what seems to be a shorter and more efficient method.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE-2:&lt;/STRONG&gt; It appears that &lt;CODE&gt;SED-*&lt;/CODE&gt; entries are executed prior to &lt;CODE&gt;TRANSFORMS-*&lt;/CODE&gt;. This caused issues with some events not being indexed.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 14:00:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120007#M24970</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-10-29T14:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120008#M24971</link>
      <description>&lt;P&gt;Sample events?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 14:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120008#M24971</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-10-29T14:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120009#M24972</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;REGEX = ^(?!.*(Keyword1|Keyword2)).*$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Oct 2013 15:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120009#M24972</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-10-29T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120010#M24973</link>
      <description>&lt;P&gt;I would probably do it the other way around;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Forwarding/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/Forwarding/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_source_or_sourcetype]
TRANSFORMS-set = setnull, keepsome
SEDCMD-keep = s/this/that/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[keepsome]
REGEX = (keyword1|keyword2)
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 16:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120010#M24973</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-29T16:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120011#M24974</link>
      <description>&lt;P&gt;This way does work, but it seems inefficient to send everything to the nullQueue first and then pull out what I need. Even though this is the method that is described in the docs. I was hoping to just send only what I don't need to the nullQueue but if there is no difference in performance then maybe it doesn't matter.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 18:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120011#M24974</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-10-29T18:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120012#M24975</link>
      <description>&lt;P&gt;Thanks. This seems to work. One thing I noticed is that additional unwanted events were coming through if they contained Keyword1somethingelse so I modified the regex as so &lt;CODE&gt;^(?!.*(Keyword1|Keyword2)\b).*$&lt;/CODE&gt;. However, Keyword1somethingelse is still coming through even though the regex seems to work correctly when I test it in a Splunk search. Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 18:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120012#M24975</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-10-29T18:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120013#M24976</link>
      <description>&lt;P&gt;Have you restarted the instance?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 19:14:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120013#M24976</guid>
      <dc:creator>ShaneNewman</dc:creator>
      <dc:date>2013-10-29T19:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120014#M24977</link>
      <description>&lt;P&gt;I thought I did; I restarted Splunk and it seems to be working as expected. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2013 08:47:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120014#M24977</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-10-30T08:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter events and use SEDCMD?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120015#M24978</link>
      <description>&lt;P&gt;Please help with this! I believe I'm missing something.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/334199/index-only-few-fields-and-ignore-the-other-fields.html"&gt;https://answers.splunk.com/answers/334199/index-only-few-fields-and-ignore-the-other-fields.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 18:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-events-and-use-SEDCMD/m-p/120015#M24978</guid>
      <dc:creator>allan_newton</dc:creator>
      <dc:date>2015-12-10T18:09:15Z</dc:date>
    </item>
  </channel>
</rss>

