<?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 Splunk table get values smaller than 4 months in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485693#M135898</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the below query which works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{My search}
| rename user_id as User
| stats max(asctime) as "Last login time (UTC)" by User
| table User "Last login time (UTC)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now from the table result, I want to get only the raws where "Last login time (UTC)" is 4 months ago or older.&lt;/P&gt;

&lt;P&gt;Many thanks for your help!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2020 10:56:53 GMT</pubDate>
    <dc:creator>anouar_jben</dc:creator>
    <dc:date>2020-03-04T10:56:53Z</dc:date>
    <item>
      <title>Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485693#M135898</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have the below query which works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{My search}
| rename user_id as User
| stats max(asctime) as "Last login time (UTC)" by User
| table User "Last login time (UTC)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now from the table result, I want to get only the raws where "Last login time (UTC)" is 4 months ago or older.&lt;/P&gt;

&lt;P&gt;Many thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 10:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485693#M135898</guid>
      <dc:creator>anouar_jben</dc:creator>
      <dc:date>2020-03-04T10:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485694#M135899</link>
      <description>&lt;P&gt;Try this.  If the 'asctime' field is text rather than epoch time then it won't work, but then again, your current query won't work, either.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{My search}
| rename user_id as User
| stats max(asctime) as maxasctime by User
| where maxasctime &amp;lt; relative_time(now(), "-4mon")
| rename maxasctime as "Last login time (UTC)"
| table User "Last login time (UTC)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 13:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485694#M135899</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-04T13:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485695#M135900</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;asctime has the following format:        &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;asctime:     2020-03-04 13:33:29,020    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you please advise what should I change in this case?&lt;/P&gt;

&lt;P&gt;Thanks again and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485695#M135900</guid>
      <dc:creator>anouar_jben</dc:creator>
      <dc:date>2020-03-04T14:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485696#M135901</link>
      <description>&lt;P&gt;Aha! I found it. It worked this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | where strptime(maxasctime,"%Y-%m-%d") &amp;lt; relative_time(now(), "-4mon")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Many thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:07:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485696#M135901</guid>
      <dc:creator>anouar_jben</dc:creator>
      <dc:date>2020-03-04T14:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485697#M135902</link>
      <description>&lt;P&gt;Good job @anouar_jben&lt;BR /&gt;
I have a few question.&lt;BR /&gt;
your timezone is UTC?&lt;BR /&gt;
now() is local time. &lt;BR /&gt;
but  it will be okay because it is on a monthly basis.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 07:57:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485697#M135902</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-05T07:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk table get values smaller than 4 months</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485698#M135903</link>
      <description>&lt;P&gt;Well seen @to4kawa ! you are right, I should convert both variables to the same timezone to have more accurate results. I will work on it.&lt;BR /&gt;
Thanks and regards&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 08:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-table-get-values-smaller-than-4-months/m-p/485698#M135903</guid>
      <dc:creator>anouar_jben</dc:creator>
      <dc:date>2020-03-05T08:30:34Z</dc:date>
    </item>
  </channel>
</rss>

