<?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: last time of user login needs to evaluate in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359188#M174559</link>
    <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2017 11:12:45 GMT</pubDate>
    <dc:creator>deepak_dhankhar</dc:creator>
    <dc:date>2017-06-20T11:12:45Z</dc:date>
    <item>
      <title>last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359182#M174553</link>
      <description>&lt;P&gt;need to evaluate the duration of last time user logged in and time now.&lt;BR /&gt;
problem I am facing is in lastTime I am getting values like "1473248264"&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:34:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359182#M174553</guid>
      <dc:creator>deepak_dhankhar</dc:creator>
      <dc:date>2017-06-20T10:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359183#M174554</link>
      <description>&lt;P&gt;Hi deepak.dhankhar,&lt;BR /&gt;
value isin epoch time, to translate it in human readable format you have to convert it:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;if you have a date use &lt;CODE&gt;| eval new_value=strftime(your_value,"%Y-%m-%d.%H:%M:%S")&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;if you have a duration use &lt;CODE&gt;| eval duration=tostring(your_value,"duration")&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359183#M174554</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-06-20T10:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359184#M174555</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;you need to use the command &lt;CODE&gt;strftime&lt;/CODE&gt;to convert this timeformat into a more human readable.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yoursearch&amp;gt; | eval LASTTIME=strftime(lastTime,"%d-%m-%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359184#M174555</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-06-20T10:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359185#M174556</link>
      <description>&lt;P&gt;Got the last time in readable format, but still unable to compair it to current time&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359185#M174556</guid>
      <dc:creator>deepak_dhankhar</dc:creator>
      <dc:date>2017-06-20T10:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359186#M174557</link>
      <description>&lt;P&gt;If you just want to change the time from epoch time to human readable string format, you should better use fieldformat which will format the data without changing the underlying data. For calculating the last login duration as compared to current time you can use now() function for getting current time and compare to lastTime (which is epoch time as per your question). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Your Base Search&amp;gt;
| eval durationInSec=now()-lastTime
| fieldformat  lastTime=strftime(lastTime,"%c")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use your own time format specified, I have used %c as an example for convenience.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359186#M174557</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-20T10:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359187#M174558</link>
      <description>&lt;P&gt;sorry, I think you didnt got my question correct i think. let me elobrate it for you.&lt;/P&gt;

&lt;P&gt;lastTime is the field I am getting the user's last time login time&lt;BR /&gt;
now with "eval LASTTIME=strftime(lastTime,"%d-%m-%Y %H:%M:%S")" I got this is in readable format,&lt;BR /&gt;
Now I need is the difference between that time and now currrent time.&lt;/P&gt;

&lt;P&gt;that will give me the user's has not logged in from that much time, hope I am clear now&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 10:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359187#M174558</guid>
      <dc:creator>deepak_dhankhar</dc:creator>
      <dc:date>2017-06-20T10:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359188#M174559</link>
      <description>&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 11:12:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359188#M174559</guid>
      <dc:creator>deepak_dhankhar</dc:creator>
      <dc:date>2017-06-20T11:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359189#M174560</link>
      <description>&lt;P&gt;hi deepak.dhankhar,&lt;BR /&gt;
to compair it to current time, you have to:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;convert it in epochtime using strptime function in eval command,&lt;/LI&gt;
&lt;LI&gt;compair to current time,&lt;/LI&gt;
&lt;LI&gt;show as duration.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;in other words something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval your_time=strptime(your_time,"your_format"), duration=tostring(now()-your_time,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 11:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359189#M174560</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-06-20T11:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: last time of user login needs to evaluate</title>
      <link>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359190#M174561</link>
      <description>&lt;P&gt;Thanks for the clarification.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2017 12:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/last-time-of-user-login-needs-to-evaluate/m-p/359190#M174561</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2017-06-20T12:35:21Z</dc:date>
    </item>
  </channel>
</rss>

