<?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 date modifier in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237253#M188616</link>
    <description>&lt;P&gt;Hey guys.&lt;/P&gt;

&lt;P&gt;I want to find hosts for all time which haven't any messages last 7 days, trying this:&lt;/P&gt;

&lt;P&gt;index=main source=syslog | dedup host  | table _time host | search latest=-7d&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jul 2016 10:49:31 GMT</pubDate>
    <dc:creator>Shark2112</dc:creator>
    <dc:date>2016-07-04T10:49:31Z</dc:date>
    <item>
      <title>date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237253#M188616</link>
      <description>&lt;P&gt;Hey guys.&lt;/P&gt;

&lt;P&gt;I want to find hosts for all time which haven't any messages last 7 days, trying this:&lt;/P&gt;

&lt;P&gt;index=main source=syslog | dedup host  | table _time host | search latest=-7d&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 10:49:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237253#M188616</guid>
      <dc:creator>Shark2112</dc:creator>
      <dc:date>2016-07-04T10:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237254#M188617</link>
      <description>&lt;P&gt;you should do this in two steps:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;populate a lookup with all you hosts using a search or uploading a csv,&lt;/LI&gt;
&lt;LI&gt;creating a search that check if all the hosts in the lookup are present in the last 7 days&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;populate the lookup&lt;/STRONG&gt; &lt;BR /&gt;
&lt;EM&gt;| metasearch index=main source=syslog | dedup host | table host | outputlookup HostList.csv&lt;/EM&gt;&lt;BR /&gt;
(Obviously you have to create the lookup in which the column name is "host" before to execute this search)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;check the host lookup&lt;/STRONG&gt;&lt;BR /&gt;
   | &lt;EM&gt;inputlookup HostList.csv &lt;BR /&gt;
   | eval count=0 &lt;BR /&gt;
   | eval host=upper(host) &lt;BR /&gt;
   | append [ &lt;BR /&gt;
         |metasearch index=main latest=-7d&lt;BR /&gt;
         | eval host=upper(host) &lt;BR /&gt;
         | stats count by host&lt;BR /&gt;
          ] &lt;BR /&gt;
| stats sum(count) AS Total by host &lt;BR /&gt;
| where Total=0&lt;BR /&gt;
| table host&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;The result will be a list of hosts in the lookup that doesn't send any log in the last seven days.&lt;/P&gt;

&lt;P&gt;You could have the same result putting the search used to populate the lookup in the second search (instead of |inputlookup ...), but if you have many events it will be very slow.&lt;/P&gt;

&lt;P&gt;Try this.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 11:11:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237254#M188617</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-07-04T11:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237255#M188618</link>
      <description>&lt;P&gt;thx for help!&lt;BR /&gt;
i can't see difference between make output file for all time and make search with same parameter, so this request work fine for me:&lt;/P&gt;

&lt;P&gt;index=main source=syslog | dedup host | table host&lt;BR /&gt;
| eval count=0 &lt;BR /&gt;
| eval host=upper(host) &lt;BR /&gt;
| append [ &lt;BR /&gt;
|metasearch index=main latest=-7d&lt;BR /&gt;
| eval host=upper(host) &lt;BR /&gt;
| stats count by host&lt;BR /&gt;
] &lt;BR /&gt;
| stats sum(count) AS Total by host &lt;BR /&gt;
| where Total=0&lt;BR /&gt;
| table host&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 11:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237255#M188618</guid>
      <dc:creator>Shark2112</dc:creator>
      <dc:date>2016-07-04T11:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237256#M188619</link>
      <description>&lt;P&gt;It depends by the number of events: if you have many events it will be very slow!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 11:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237256#M188619</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-07-04T11:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237257#M188620</link>
      <description>&lt;P&gt;and and you explain what difference between search and metasearch in subsearch?? thx&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 11:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237257#M188620</guid>
      <dc:creator>Shark2112</dc:creator>
      <dc:date>2016-07-04T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237258#M188621</link>
      <description>&lt;P&gt;For metasearch see this &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Metasearch"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Metasearch&lt;/A&gt;&lt;BR /&gt;
but the importance is to use a lookup instead a search on a large time period.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 12:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237258#M188621</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2016-07-04T12:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: date modifier</title>
      <link>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237259#M188622</link>
      <description>&lt;P&gt;You could just do a very long search (like last 6 months) like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main source=syslog | eval host=lower(host) | dedup host | table _time host | eval daysAgo=(now()-_time)/(60*60*24) | where daysAgo &amp;gt; 30
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Jul 2016 15:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/date-modifier/m-p/237259#M188622</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-04T15:45:40Z</dc:date>
    </item>
  </channel>
</rss>

