<?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: Exclude fields ending with specific character in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210072#M187817</link>
    <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/regex"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/regex&lt;/A&gt; explains the regex command - "The regex command removes results that do not match the specified regular expression."&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 15:21:59 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2016-02-22T15:21:59Z</dc:date>
    <item>
      <title>Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210069#M187814</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I am trying to filter out "Account_Name" that ends with $ and account names with no values( this as field value "-"). So far I have managed to exclude "-". &lt;/P&gt;

&lt;P&gt;index=&lt;EM&gt;_win eventid=4624 Security_ID=&lt;/EM&gt;  Account_Name!="-" OR Account_Name!=DHK* OR Account_Name!=*$ |stats count by win_log_time, eventid, Account_Name, host, EventCodeDescription&lt;/P&gt;

&lt;P&gt;2/22/2016 15:14 4624    -                     HST002  An account was successfully logged on 11&lt;BR /&gt;
2/22/2016 15:14 4624    ABC001$ HST002  An account was successfully logged on   1&lt;BR /&gt;
2/22/2016 15:14 4624    CBAU02$ HST002  An account was successfully logged on   1&lt;BR /&gt;
2/22/2016 15:14 4624    XYZU02          HST002  An account was successfully logged on   1&lt;/P&gt;

&lt;P&gt;And yet this gives me results with field values "-" and ending with $. &lt;/P&gt;

&lt;P&gt;If i take out "Account_Name!=*$ " and also take out "OR" to make my query something like this&lt;/P&gt;

&lt;P&gt;index=&lt;EM&gt;_win eventid=4624 Security_ID=&lt;/EM&gt;  Account_Name!="-" Account_Name!=DHK* &lt;/P&gt;

&lt;P&gt;The resulting output is: &lt;/P&gt;

&lt;P&gt;2/22/2016 15:14 4624    ABC001$ HST002  An account was successfully logged on   1&lt;BR /&gt;
2/22/2016 15:14 4624    CBAU02$ HST002  An account was successfully logged on   1&lt;BR /&gt;
2/22/2016 15:14 4624    XYZU02          HST002  An account was successfully logged on   1&lt;/P&gt;

&lt;P&gt;Am I doing something wrong, I am expecting the output to be only like this:&lt;/P&gt;

&lt;P&gt;2/22/2016 15:14 4624    XYZU02          HST002  An account was successfully logged on   1&lt;/P&gt;

&lt;P&gt;Please help me as i have tried to use NOT and WHERE commands too but still doesn't work.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210069#M187814</guid>
      <dc:creator>shaker_ali</dc:creator>
      <dc:date>2020-09-29T08:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210070#M187815</link>
      <description>&lt;P&gt;Looks like you cut out your securityID value in your query above, try the below but put it back in.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_win eventid=4624 Account_Name!=DHK* | regex Account_Name=".*(?&amp;lt;!\$)$" |stats count by win_log_time, eventid, Account_Name, host, EventCodeDescription
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also keep in mind you might have blankspaces in your Account_Name, so you might need to do  Account_Name!="-&lt;EM&gt;" OR Account_Name!=&lt;/EM&gt;$*&lt;/P&gt;

&lt;P&gt;If you wanted to keep it without the regex.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210070#M187815</guid>
      <dc:creator>ryandg</dc:creator>
      <dc:date>2020-09-29T08:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210071#M187816</link>
      <description>&lt;P&gt;The logical condition that you need to exclude both "-" and Accound_Name ending with $ will be AND. That is the default logical operator anyways So try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_win eventid=4624 Security_ID= Account_Name!="-" Account_Name!=DHK* Account_Name!=*$ |stats count by win_log_time, eventid, Account_Name, host, EventCodeDescription
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 15:21:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210071#M187816</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-22T15:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210072#M187817</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/regex"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/regex&lt;/A&gt; explains the regex command - "The regex command removes results that do not match the specified regular expression."&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 15:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210072#M187817</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-02-22T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210073#M187818</link>
      <description>&lt;P&gt;right and the regex I am doing is for anything that doesn't end in $ -- so this regex would return everything !=*$ -- though when i put it into regex101 it appears that it also negates the "-" as well.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 16:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210073#M187818</guid>
      <dc:creator>ryandg</dc:creator>
      <dc:date>2016-02-22T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude fields ending with specific character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210074#M187819</link>
      <description>&lt;P&gt;Also, the reason regex should be used is that it's faster than using a !=*$ and a !="-" as != are quite slow in large data sets.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 16:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclude-fields-ending-with-specific-character/m-p/210074#M187819</guid>
      <dc:creator>ryandg</dc:creator>
      <dc:date>2016-02-22T16:43:38Z</dc:date>
    </item>
  </channel>
</rss>

