<?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: Why isn't this regex working on /var/log? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306191#M91932</link>
    <description>&lt;P&gt;Each key is on a your line. The code style of answers that put all into a single line @DalJeanis.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2017 18:59:20 GMT</pubDate>
    <dc:creator>rafamss</dc:creator>
    <dc:date>2017-11-28T18:59:20Z</dc:date>
    <item>
      <title>Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306187#M91928</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm using a Single Instance of Splunk 6.6.2 and I've tried filtering some events of my log using the code below, but the filter doesn't work. I put this argument &lt;STRONG&gt;"[\dbus]"&lt;/STRONG&gt; into regex because I don't want this to be indexed. What's wrong with this?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/messages]
disabled = 0
index = main
sourcetype = my_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
TRANSFORMS-null = setnull
&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 = \[dbus\]
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306187#M91928</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-11-28T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306188#M91929</link>
      <description>&lt;P&gt;The inputs stanza should be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/messages]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Are there any internal errors you see when you search "index=_internal"?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 17:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306188#M91929</guid>
      <dc:creator>nileena</dc:creator>
      <dc:date>2017-11-28T17:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306189#M91930</link>
      <description>&lt;P&gt;Just to verify - each key word is on a line by itself, true?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [setnull] 
  REGEX = \[dbus\] 
  DEST_KEY = queue 
  FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Nov 2017 18:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306189#M91930</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-28T18:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306190#M91931</link>
      <description>&lt;P&gt;As a fact @nileena. In my environment I put the stanza like as below. In the internal index don't have any error that contains references to this.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[monitor:///var/log/messages]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
index = main&lt;BR /&gt;
sourcetype = my_sourcetype&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 18:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306190#M91931</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-11-28T18:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306191#M91932</link>
      <description>&lt;P&gt;Each key is on a your line. The code style of answers that put all into a single line @DalJeanis.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 18:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306191#M91932</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-11-28T18:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306192#M91933</link>
      <description>&lt;P&gt;Can you share some sample raw data that you want to drop? (mask any sensitive information)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 19:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306192#M91933</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-28T19:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306193#M91934</link>
      <description>&lt;P&gt;Sure &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;.&lt;/P&gt;

&lt;P&gt;Nov 28 18:02:53 localhost dbus-daemon: dbus[409]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'&lt;BR /&gt;
Nov 28 18:02:53 localhost dbus-daemon: dbus[809]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'&lt;BR /&gt;
Nov 28 18:02:53 localhost dbus-daemon: dbus[981]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'Nov 28 18:02:53 localhost dbus-daemon: dbus[604]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'&lt;BR /&gt;
Nov 28 18:02:53 localhost dbus[605]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'&lt;BR /&gt;
Nov 28 18:02:53 localhost dbus[600]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306193#M91934</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2020-09-29T16:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306194#M91935</link>
      <description>&lt;P&gt;So you want to drop any event which has word &lt;CODE&gt;dbus&lt;/CODE&gt;? Or is it &lt;CODE&gt;dbus[&lt;/CODE&gt;? If that's the case, your REGEX in your transforms.conf should be this &lt;CODE&gt;REGEX = dbus&lt;/CODE&gt; OR &lt;CODE&gt;REGEX = dbus\[&lt;/CODE&gt; for second case.&lt;/P&gt;

&lt;P&gt;The current value of &lt;CODE&gt;REGEX = \[dbus\]&lt;/CODE&gt; actually looks for literal string &lt;CODE&gt;[dbus]&lt;/CODE&gt; in the events, which I don't see in your sample data, hence it didn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 20:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306194#M91935</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-28T20:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306195#M91936</link>
      <description>&lt;P&gt;I suspect that you are copying too literally from the example docs here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The example there shows this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that is because it is trying to match the EXACT string &lt;CODE&gt;[sshd]&lt;/CODE&gt;.  You are probably trying to match the exact string &lt;CODE&gt;dbus&lt;/CODE&gt; so you should use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = dbus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Nov 2017 00:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306195#M91936</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-11-29T00:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306196#M91937</link>
      <description>&lt;P&gt;Is exactly that @woodcock (I followed this example). But even puting &lt;STRONG&gt;dbus&lt;/STRONG&gt; or &lt;STRONG&gt;[dbus]&lt;/STRONG&gt; into REGEX option, this still not work.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 12:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306196#M91937</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-11-29T12:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306197#M91938</link>
      <description>&lt;P&gt;Is exactly what I want to do. Drop all events with dbus and store the events that not have this parameter. I'll test your sample and go back here.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 12:39:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306197#M91938</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-11-29T12:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306198#M91939</link>
      <description>&lt;P&gt;What behaviour are you expecting? The transform you posted  will dump every event that contains the string &lt;CODE&gt;[dbus]&lt;/CODE&gt;.  If the splunk search &lt;CODE&gt;sourcetype=my_sourcetype TERM("\[dbus\]")&lt;/CODE&gt; returns no events then its working. &lt;/P&gt;

&lt;P&gt;Where have you put the props and transforms file? They must be on the indexer. Also you need to restart splunk after updating the transform.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 12:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306198#M91939</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-11-29T12:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306199#M91940</link>
      <description>&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Make sure you have corrected your inputs.conf file to monitor&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;At transforms.conf - you might need to correct the regex to &lt;/P&gt;

&lt;P&gt;REGEX = &lt;CODE&gt;dbus(\-|\[)*&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;(here you are matching with either &lt;CODE&gt;dbus-*&lt;/CODE&gt; OR &lt;CODE&gt;dbus[*&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Carefully have a look on your raw data - there is no &lt;STRONG&gt;exact&lt;/STRONG&gt; word "dbus" as your regex suggests, there is "dbus*". To be precise - its either "dbus-&lt;EM&gt;" OR "dbus[&lt;/EM&gt;" &lt;/P&gt;

&lt;P&gt;I would suggest you to make this change and then &lt;STRONG&gt;restart&lt;/STRONG&gt; your single instance splunk to verify the results. &lt;/P&gt;

&lt;P&gt;Correct me if i am wrong. I would wait for your feedback. Thanks, &lt;BR /&gt;
Saurabh &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306199#M91940</guid>
      <dc:creator>saurabh_tek11</dc:creator>
      <dc:date>2020-09-29T16:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306200#M91941</link>
      <description>&lt;P&gt;Make sure that your sourcetype is right in the stanza header.  Make sure that you deploy the file to the indexers (or Heavy Forwarders).  Make sure that you restart all Splunk instances there.  Make sure that you verify/test by looking at events that were forwarded in after the restarts (previously indexed events do NOT get re-examines and deleted).&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 13:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306200#M91941</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-11-29T13:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306201#M91942</link>
      <description>&lt;P&gt;@rafamss - Does this help?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 19:07:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306201#M91942</guid>
      <dc:creator>saurabh_tek11</dc:creator>
      <dc:date>2017-11-30T19:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306202#M91943</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;
All this options above did help me to do the configuration that worked in my environment. Below, follow what I did.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log]
disabled = false
sourcetype = my_sourcetype
index = main
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
TRANSFORMS = null_queue_filter
&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;[null_queue_filter]
REGEX = .dbus.
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank all!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306202#M91943</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-12-04T15:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306203#M91944</link>
      <description>&lt;P&gt;Be sure to &lt;CODE&gt;UpVote&lt;/CODE&gt; every helpful answer and comment.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306203#M91944</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-04T15:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306204#M91945</link>
      <description>&lt;P&gt;Done @woodcock!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 18:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306204#M91945</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2017-12-04T18:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why isn't this regex working on /var/log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306205#M91946</link>
      <description>&lt;P&gt;Yes, it does. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 21:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-isn-t-this-regex-working-on-var-log/m-p/306205#M91946</guid>
      <dc:creator>rafamss</dc:creator>
      <dc:date>2019-10-28T21:36:19Z</dc:date>
    </item>
  </channel>
</rss>

