<?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 How do I add an additional search condition to my table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456525#M129047</link>
    <description>&lt;P&gt;&lt;CODE&gt;index= client_snsr_tcg_unix_webservices source="/var/log/tomcat8/catalina.out" &lt;BR /&gt;
| rex "^\[(?[^\]]+)\].*\[(?[^\]]+)\]\[(?[a-zA-Z]*)\](?[^\(]+)\(\d*\)(.*makeModel=(?.*),make)*(:StdOUT (?.*))*.*" &lt;BR /&gt;
| eval _time=strptime(time,"%a %b %d %H:%M:%S") &lt;BR /&gt;
| fields - _raw time &lt;BR /&gt;
| stats count as eventCount min(_time) as _time max(_time) as latestTime values(type) as allTypes values(device) as device values(name) as name values(macaddress) as macaddress by ip &lt;BR /&gt;
| eval duration=(latestTime-_time)&lt;BR /&gt;
| fields - latestTime &lt;BR /&gt;
| search allTypes="NodeManager.getNodeByHWaddress" AND allTypes!="ActivateNode.doPost" AND allTypes="RegistrationController.initOsList" AND allTypes="GetPolicy.doPost" | fields - allTypes&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The above search query creates a table which has a column with users' macaddresses. There is an additional condition I want to add to the table that I don't know how to do. The condition is to only display the users whose macaddresses appears in the past logs on different days. I'm trying to find the users that use my program multiple times in the past and keeps using it.&lt;/P&gt;

&lt;P&gt;If the below search returns events that are on different days, then I want to display this user in the table I created above. Thanks!&lt;BR /&gt;
&lt;CODE&gt;index= client_snsr_tcg_unix_webservices source="/var/log/tomcat8/catalina.out" 3c-43-a3-cc-f5-3f&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Aug 2019 14:23:31 GMT</pubDate>
    <dc:creator>elijahm</dc:creator>
    <dc:date>2019-08-19T14:23:31Z</dc:date>
    <item>
      <title>How do I add an additional search condition to my table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456525#M129047</link>
      <description>&lt;P&gt;&lt;CODE&gt;index= client_snsr_tcg_unix_webservices source="/var/log/tomcat8/catalina.out" &lt;BR /&gt;
| rex "^\[(?[^\]]+)\].*\[(?[^\]]+)\]\[(?[a-zA-Z]*)\](?[^\(]+)\(\d*\)(.*makeModel=(?.*),make)*(:StdOUT (?.*))*.*" &lt;BR /&gt;
| eval _time=strptime(time,"%a %b %d %H:%M:%S") &lt;BR /&gt;
| fields - _raw time &lt;BR /&gt;
| stats count as eventCount min(_time) as _time max(_time) as latestTime values(type) as allTypes values(device) as device values(name) as name values(macaddress) as macaddress by ip &lt;BR /&gt;
| eval duration=(latestTime-_time)&lt;BR /&gt;
| fields - latestTime &lt;BR /&gt;
| search allTypes="NodeManager.getNodeByHWaddress" AND allTypes!="ActivateNode.doPost" AND allTypes="RegistrationController.initOsList" AND allTypes="GetPolicy.doPost" | fields - allTypes&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The above search query creates a table which has a column with users' macaddresses. There is an additional condition I want to add to the table that I don't know how to do. The condition is to only display the users whose macaddresses appears in the past logs on different days. I'm trying to find the users that use my program multiple times in the past and keeps using it.&lt;/P&gt;

&lt;P&gt;If the below search returns events that are on different days, then I want to display this user in the table I created above. Thanks!&lt;BR /&gt;
&lt;CODE&gt;index= client_snsr_tcg_unix_webservices source="/var/log/tomcat8/catalina.out" 3c-43-a3-cc-f5-3f&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 14:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456525#M129047</guid>
      <dc:creator>elijahm</dc:creator>
      <dc:date>2019-08-19T14:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an additional search condition to my table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456526#M129048</link>
      <description>&lt;P&gt;Try adding this to the end of your query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| bucket span=1d _time | stats count values(*) as * by macaddress | where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Aug 2019 14:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456526#M129048</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-19T14:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an additional search condition to my table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456527#M129049</link>
      <description>&lt;P&gt;It makes my table return only 1 statistic with the macaddresses column empty and the other columns listing its elements in the one statistic so i can't tell what information is correlated to which user. &lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 15:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456527#M129049</guid>
      <dc:creator>elijahm</dc:creator>
      <dc:date>2019-08-19T15:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an additional search condition to my table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456528#M129050</link>
      <description>&lt;P&gt;You can use 'join' command if you want to retrieve the list of users for the mac addresses which you have obtained. OR you can use 'appendcols' if both queries are not related .&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 15:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456528#M129050</guid>
      <dc:creator>ansusabu</dc:creator>
      <dc:date>2019-08-19T15:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add an additional search condition to my table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456529#M129051</link>
      <description>&lt;P&gt;The macaddress field would be empty only if none of the events have a value for that column by the time the &lt;CODE&gt;stats&lt;/CODE&gt; command runs.  What do your results look like before the &lt;CODE&gt;bucket&lt;/CODE&gt; command?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 17:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-an-additional-search-condition-to-my-table/m-p/456529#M129051</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-19T17:04:19Z</dc:date>
    </item>
  </channel>
</rss>

