<?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: REGEX transforms.conf, NOT operator in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44788#M10577</link>
    <description>&lt;P&gt;Have you looked at the docs?&lt;/P&gt;

&lt;P&gt;If you have a known event that you do NOT want, you can use a matching REGEX to send that event to the &lt;CODE&gt;nullQueue&lt;/CODE&gt;. The rest are automatically sent to the &lt;CODE&gt;parsingQueue&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to only keep a known set of events, you do as you did above, i.e. set the queue to &lt;CODE&gt;nullQueue&lt;/CODE&gt; for all events, and then overwrite that with &lt;CODE&gt;parsingQueue&lt;/CODE&gt; for the events you wish to keep.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;UPDATE:&lt;BR /&gt;
Saw that you send the events to &lt;CODE&gt;indexQueue&lt;/CODE&gt;. You might be right but you probably want the &lt;CODE&gt;parsingQueue&lt;/CODE&gt;.&lt;BR /&gt;
Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:46:38 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2020-09-28T11:46:38Z</dc:date>
    <item>
      <title>REGEX transforms.conf, NOT operator</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44787#M10576</link>
      <description>&lt;P&gt;Hi Splunkers&lt;/P&gt;

&lt;P&gt;I'm new to splunk and currently playing around with the heavy forwarder. I found here several examples how to match a specific string in an event and only forward that event to the indexer. However, I could not find the opposite.&lt;/P&gt;

&lt;P&gt;Here is what I would like to do.&lt;/P&gt;

&lt;P&gt;Let's say in /var/log/messages we have those two log entries:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;May 7 08:00:14 &amp;lt;host&amp;gt; &amp;lt;user&amp;gt;: Splunk, get that line!&lt;BR /&gt;
May 7 08:01:45 &amp;lt;host&amp;gt; &amp;lt;user&amp;gt;: Splunk, miss that line!&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;My props.conf contains:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[source::/var/log/messages]&lt;BR /&gt;
TRANSFORMS-set=setnull,ignore&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;My transforms.conf contains:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[setnull]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[ignore]&lt;BR /&gt;
REGEX = !miss&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have tryed several regex for the &lt;STRONG&gt;NOT miss&lt;/STRONG&gt; part. So far I have not found any solution. Again, my goal is not to match the first line. I know how that is done. I want to match everything except something with a key word. At the end I should be able to exclude known events and always receive on my indexer what is wanted or sofar unknown.&lt;/P&gt;

&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2012 14:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44787#M10576</guid>
      <dc:creator>aspa</dc:creator>
      <dc:date>2012-05-07T14:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX transforms.conf, NOT operator</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44788#M10577</link>
      <description>&lt;P&gt;Have you looked at the docs?&lt;/P&gt;

&lt;P&gt;If you have a known event that you do NOT want, you can use a matching REGEX to send that event to the &lt;CODE&gt;nullQueue&lt;/CODE&gt;. The rest are automatically sent to the &lt;CODE&gt;parsingQueue&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to only keep a known set of events, you do as you did above, i.e. set the queue to &lt;CODE&gt;nullQueue&lt;/CODE&gt; for all events, and then overwrite that with &lt;CODE&gt;parsingQueue&lt;/CODE&gt; for the events you wish to keep.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.1/Deploy/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;UPDATE:&lt;BR /&gt;
Saw that you send the events to &lt;CODE&gt;indexQueue&lt;/CODE&gt;. You might be right but you probably want the &lt;CODE&gt;parsingQueue&lt;/CODE&gt;.&lt;BR /&gt;
Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44788#M10577</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T11:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX transforms.conf, NOT operator</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44789#M10578</link>
      <description>&lt;P&gt;Hello Kristian&lt;/P&gt;

&lt;P&gt;Thank you for your reply. I figured out where my failure was in the configuration. Your post helped me a lot!&lt;/P&gt;

&lt;P&gt;I just post shortly my solution:&lt;/P&gt;

&lt;P&gt;The props.conf remains almost the same as above:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[source::/var/log/messages]&lt;BR /&gt;
TRANSFORMS-set=ignore&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The transforms.conf changed the most and is now shorter:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[ignore]&lt;BR /&gt;
REGEX = miss&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;By sending the event matching the REGEX to the nullQueue, the event is not forwarded to the indexer.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 12:35:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-transforms-conf-NOT-operator/m-p/44789#M10578</guid>
      <dc:creator>aspa</dc:creator>
      <dc:date>2012-05-08T12:35:35Z</dc:date>
    </item>
  </channel>
</rss>

