<?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 Is there a better way to convert the age output into a more readable format (i.e. days)? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501792#M85496</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm attempting to track AWS related password events in my Splunk.&lt;/P&gt;

&lt;P&gt;I am sifting through my index and receiving the data I need -- however I am having an issue with converting the "age" from a unix based notation.&lt;/P&gt;

&lt;P&gt;I am using the following to determine the age of passwords:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval age =_time   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My output is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PasswordLastUsed                                                                            age
018448995162    user    2020-02-14T20:49:08+00:00   1585319203
018448995162    user    2020-02-13T16:59:30+00:00   1585319203
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a better way to convert the age output into a more readable format (i.e. days)?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Kiran&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Fri, 27 Mar 2020 17:03:39 GMT</pubDate>
    <dc:creator>kppradhan</dc:creator>
    <dc:date>2020-03-27T17:03:39Z</dc:date>
    <item>
      <title>Is there a better way to convert the age output into a more readable format (i.e. days)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501792#M85496</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm attempting to track AWS related password events in my Splunk.&lt;/P&gt;

&lt;P&gt;I am sifting through my index and receiving the data I need -- however I am having an issue with converting the "age" from a unix based notation.&lt;/P&gt;

&lt;P&gt;I am using the following to determine the age of passwords:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval age =_time   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My output is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PasswordLastUsed                                                                            age
018448995162    user    2020-02-14T20:49:08+00:00   1585319203
018448995162    user    2020-02-13T16:59:30+00:00   1585319203
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a better way to convert the age output into a more readable format (i.e. days)?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Kiran&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 27 Mar 2020 17:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501792#M85496</guid>
      <dc:creator>kppradhan</dc:creator>
      <dc:date>2020-03-27T17:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to convert the age output into a more readable format (i.e. days)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501793#M85497</link>
      <description>&lt;P&gt;The _time field is the date and time when the event occurred.  It's probably not the best choice for password age.&lt;/P&gt;

&lt;P&gt;That said, use the &lt;CODE&gt;strftime&lt;/CODE&gt; function to make epochs readable.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval age = strftime(_time, "%Y-%m-%d %H:%M:S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use the &lt;CODE&gt;convert&lt;/CODE&gt; command, instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | convert timeformat="%Y-%m-%d %H:%M:S" ctime(_time) as age
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Mar 2020 19:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501793#M85497</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-27T19:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a better way to convert the age output into a more readable format (i.e. days)?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501794#M85498</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval age = now() - _time
| fieldformat age = tostring(age, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 06:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-better-way-to-convert-the-age-output-into-a-more/m-p/501794#M85498</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-31T06:52:12Z</dc:date>
    </item>
  </channel>
</rss>

