<?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 in search to filter not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236540#M70272</link>
    <description>&lt;P&gt;Why not simply use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search ..| search user!="*-abc"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Sep 2015 20:18:09 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-09-21T20:18:09Z</dc:date>
    <item>
      <title>Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236539#M70271</link>
      <description>&lt;P&gt;I am currently trying to work on a search where are admins in my results. I want the search to show only regular users and admins are noted by a -abc next to their name. This is what I currently have and I get the same amount of results with or without regex: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | regex &amp;lt;user&amp;gt;!="&amp;lt;-abc&amp;gt;" | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So for example the user field will have johnny and a separate line for johnny-abc. I want to search and not have a result if -abc is found in the user field. &lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 20:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236539#M70271</guid>
      <dc:creator>santorof</dc:creator>
      <dc:date>2015-09-21T20:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236540#M70272</link>
      <description>&lt;P&gt;Why not simply use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search ..| search user!="*-abc"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Sep 2015 20:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236540#M70272</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-21T20:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236541#M70273</link>
      <description>&lt;P&gt;could you please provide some sample events?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 20:19:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236541#M70273</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-09-21T20:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236542#M70274</link>
      <description>&lt;P&gt;Assuming you have a field named &lt;CODE&gt;user&lt;/CODE&gt; which has values such as &lt;CODE&gt;woodcock-abc&lt;/CODE&gt; for admins and values such as &lt;CODE&gt;otherguy&lt;/CODE&gt; for non-admins, you should be able to use this (among &lt;EM&gt;many&lt;/EM&gt; other ways):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | regex user!=".*\-abc$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Sep 2015 21:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236542#M70274</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-21T21:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236543#M70275</link>
      <description>&lt;P&gt;This worked as well as the suggestion from Wood about regex. Thank you! &lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 12:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236543#M70275</guid>
      <dc:creator>santorof</dc:creator>
      <dc:date>2015-09-23T12:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236544#M70276</link>
      <description>&lt;P&gt;Could you explain to me what the .  , forward slash, and $ are for? I have been looking at the regex documentation and cant seem to find anything solid. I would like to know this so I can do a regex to take into account a abc-USERNAME where abc- is what I would want to filter against to not include. In this case abc- is at the begining and the *(everything) would come after &lt;/P&gt;

&lt;P&gt;EDIT: I believe I got it. regex user!="abc-.*"&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 12:44:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236544#M70276</guid>
      <dc:creator>santorof</dc:creator>
      <dc:date>2015-09-25T12:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in search to filter not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236545#M70277</link>
      <description>&lt;P&gt;The &lt;CODE&gt;.&lt;/CODE&gt; matches any 1 character and the &lt;CODE&gt;*&lt;/CODE&gt; modifies the character class that precedes it with &lt;CODE&gt;zero or more of those&lt;/CODE&gt;.  The &lt;CODE&gt;\&lt;/CODE&gt; escapes the next character that follows so that it is taken literally instead of indicating special functio n/token (in this case it is sperflous and you don't need it; it was a mistake on my part).  The &lt;CODE&gt;$&lt;/CODE&gt; says &lt;CODE&gt;no more characters after this&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 16:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-search-to-filter-not-working/m-p/236545#M70277</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-09-25T16:56:36Z</dc:date>
    </item>
  </channel>
</rss>

