<?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: How to implement multiple where conditions with like statement using tstats? in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483693#M7876</link>
    <description>&lt;P&gt;Hi @cotyp,&lt;BR /&gt;
With &lt;CODE&gt;tstats&lt;/CODE&gt; you can use only  &lt;CODE&gt;from&lt;/CODE&gt;,  &lt;CODE&gt;where&lt;/CODE&gt; and  &lt;CODE&gt;by&lt;/CODE&gt; clause arguments. Personally I don't know how can I implement multiple  &lt;CODE&gt;if&lt;/CODE&gt; statements with these argements &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 15:55:40 GMT</pubDate>
    <dc:creator>woodentree</dc:creator>
    <dc:date>2020-02-27T15:55:40Z</dc:date>
    <item>
      <title>How to implement multiple where conditions with like statement using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483691#M7874</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We'd like to monitor configuration changes on our Linux host. For that we want to detect when in the datamodel  &lt;CODE&gt;Auditd&lt;/CODE&gt; the field  &lt;CODE&gt;name&lt;/CODE&gt;is equal to &lt;CODE&gt;/etc/audit/*&lt;/CODE&gt;,  &lt;CODE&gt;/etc/audisp/*&lt;/CODE&gt;, or  &lt;CODE&gt;/etc/libaudit.conf&lt;/CODE&gt;. Here is our basic search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats `security_content_summariesonly` count  from datamodel=Auditd where nodename=Auditd.Path by _time span=1s host Auditd.name
| `drop_dm_object_name("Auditd")`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The question is how can we implement in the same search 3 conditions below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where like(name,"%/etc/audit/%")
| where like(name,"%/etc/audisp/%")
| where name="/etc/libaudit.conf"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Logicaly it could be done via  &lt;CODE&gt;case&lt;/CODE&gt; statement, but we wasn't able to implement it. Do you have any ideas?&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483691#M7874</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-27T13:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple where conditions with like statement using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483692#M7875</link>
      <description>&lt;P&gt;how about a multiple if statement? &lt;CODE&gt;if(like(name, "etc....%"), "etc",if(like(name, "%audisp%"), "audisp"))&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483692#M7875</guid>
      <dc:creator>cotyp</dc:creator>
      <dc:date>2020-02-27T15:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple where conditions with like statement using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483693#M7876</link>
      <description>&lt;P&gt;Hi @cotyp,&lt;BR /&gt;
With &lt;CODE&gt;tstats&lt;/CODE&gt; you can use only  &lt;CODE&gt;from&lt;/CODE&gt;,  &lt;CODE&gt;where&lt;/CODE&gt; and  &lt;CODE&gt;by&lt;/CODE&gt; clause arguments. Personally I don't know how can I implement multiple  &lt;CODE&gt;if&lt;/CODE&gt; statements with these argements &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483693#M7876</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-27T15:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple where conditions with like statement using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483694#M7877</link>
      <description>&lt;P&gt;Try something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats `security_content_summariesonly` count  from datamodel=Auditd where nodename=Auditd.Path by _time span=1s host Auditd.name     | `drop_dm_object_name("Auditd")`     

  | search name="*/etc/audit/*" OR name="*/etc/audisp/*" OR name="*/etc/libaudit.conf*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 16:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483694#M7877</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2020-02-27T16:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple where conditions with like statement using tstats?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483695#M7878</link>
      <description>&lt;P&gt;Exactly!&lt;BR /&gt;
Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/How-to-implement-multiple-where-conditions-with-like-statement/m-p/483695#M7878</guid>
      <dc:creator>woodentree</dc:creator>
      <dc:date>2020-02-28T08:23:35Z</dc:date>
    </item>
  </channel>
</rss>

