<?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: In a query using the tstats command, how do you add a &amp;quot;not&amp;quot; condition before the 'count' function? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449327#M127246</link>
    <description>&lt;P&gt;@AlexeySh ,&lt;BR /&gt;
Have your tried adding the condition in where clause of data model ie. &lt;CODE&gt;...count from datamodel=Authentication.Authentication where   nodename=Authentication.Failed_Authentication AND signature_id!=4771&lt;/CODE&gt;. Sorry doesn't have a system to test it&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 13:47:34 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-02-08T13:47:34Z</dc:date>
    <item>
      <title>In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449326#M127245</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We use an ES ‘Excessive Failed Logins’ correlation search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true values(Authentication.tag) as "tag",dc(Authentication.user) as "user_count",dc(Authentication.dest) as "dest_count",count from datamodel=Authentication.Authentication where   nodename=Authentication.Failed_Authentication  by "Authentication.app","Authentication.src"  | rename "Authentication.app" as "app","Authentication.src" as "src" | where 'count'&amp;gt;=6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But we would like to add an additional condition to the search, where ‘&lt;EM&gt;signature_id&lt;/EM&gt;’ field in &lt;STRONG&gt;Failed Authentication&lt;/STRONG&gt; data model is not equal to 4771.&lt;/P&gt;

&lt;P&gt;At the end of the search, we tried to add something like &lt;CODE&gt;|where signature_id!=4771&lt;/CODE&gt; or  &lt;CODE&gt;|search NOT signature_id =4771&lt;/CODE&gt;, but of course, it didn’t work because count action happens before it.&lt;/P&gt;

&lt;P&gt;Do you have an idea how we can implement that condition?&lt;/P&gt;

&lt;P&gt;Thank for the help. &lt;/P&gt;

&lt;P&gt;Alex.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 13:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449326#M127245</guid>
      <dc:creator>AlexeySh</dc:creator>
      <dc:date>2019-02-08T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449327#M127246</link>
      <description>&lt;P&gt;@AlexeySh ,&lt;BR /&gt;
Have your tried adding the condition in where clause of data model ie. &lt;CODE&gt;...count from datamodel=Authentication.Authentication where   nodename=Authentication.Failed_Authentication AND signature_id!=4771&lt;/CODE&gt;. Sorry doesn't have a system to test it&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 13:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449327#M127246</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-08T13:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449328#M127247</link>
      <description>&lt;P&gt;@ renjith.nair unfortunately it doesn’t work.&lt;/P&gt;

&lt;P&gt;When I try to enclose &lt;CODE&gt;AND signature_id!=4771&lt;/CODE&gt; just after &lt;CODE&gt;where nodename=Authentication.Failed_Authentication&lt;/CODE&gt; there is no results found.&lt;/P&gt;

&lt;P&gt;And if I try to enclose it after by &lt;CODE&gt;"Authentication.app","Authentication.src"&lt;/CODE&gt; there is a “invalid argument” error.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 14:09:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449328#M127247</guid>
      <dc:creator>AlexeySh</dc:creator>
      <dc:date>2019-02-08T14:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449329#M127248</link>
      <description>&lt;P&gt;I tried your search including signature_id and it works for me in my env and normally we use fields to be excluded in there where clause for our other searches as well&lt;/P&gt;

&lt;P&gt;| tstats summariesonly=true allow_old_summaries=true values(Authentication.tag) as "tag",dc(Authentication.user) as "user_count",dc(Authentication.dest) as "dest_count",count from datamodel=Authentication.Authentication where   nodename=Authentication.Failed_Authentication  Authentication.signature_id!=4771" by "Authentication.app","Authentication.src"  |&lt;CODE&gt;drop_dm_object_name("Authentication")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449329#M127248</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2020-09-29T23:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449330#M127249</link>
      <description>&lt;P&gt;Have you tried this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true values(Authentication.tag) as "tag",dc(Authentication.user) as "user_count",dc(Authentication.dest) as "dest_count",count from datamodel=Authentication.Authentication where   nodename=Authentication.Failed_Authentication AND Authentication.signature_id!=4771 by "Authentication.app","Authentication.src"  | rename "Authentication.app" as "app","Authentication.src" as "src" | where 'count'&amp;gt;=6
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2019 16:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449330#M127249</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-02-08T16:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449331#M127250</link>
      <description>&lt;P&gt;Exactly!&lt;BR /&gt;
I just passed around it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 16:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449331#M127250</guid>
      <dc:creator>AlexeySh</dc:creator>
      <dc:date>2019-02-08T16:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: In a query using the tstats command, how do you add a "not" condition before the 'count' function?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449332#M127251</link>
      <description>&lt;P&gt;Yep, that's work!&lt;/P&gt;

&lt;P&gt;I tried the query with simple &lt;CODE&gt;signature_id!=4771&lt;/CODE&gt; condition and not &lt;CODE&gt;Authentication.signature_id!=4771&lt;/CODE&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 16:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/In-a-query-using-the-tstats-command-how-do-you-add-a-quot-not/m-p/449332#M127251</guid>
      <dc:creator>AlexeySh</dc:creator>
      <dc:date>2019-02-08T16:19:42Z</dc:date>
    </item>
  </channel>
</rss>

