<?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: Convert Splunk default time to human readable format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30413#M6156</link>
    <description>&lt;P&gt;You can use the convert functions.&lt;BR /&gt;
see &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.4/SearchReference/Convert"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.4/SearchReference/Convert&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;example to convert and store in a new field&lt;BR /&gt;
| convert ctime(_time) as time | table _time time&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2011 17:50:30 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2011-12-07T17:50:30Z</dc:date>
    <item>
      <title>Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30412#M6155</link>
      <description>&lt;P&gt;I have the following saved search which emails result daily to show indexing volume:&lt;BR /&gt;
index=_internal host=prodlog todaysBytesIndexed LicenseManager-Audit NOT source=*web_service.log startdaysago=30 enddaysago=0 | eval Daily_Indexing_Volume_in_MBs = todaysBytesIndexed/1024/1024 | timechart avg(Daily_Indexing_Volume_in_MBs) by host&lt;/P&gt;

&lt;P&gt;However, in the emailed report, the date format is as follows:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
_time             prodlog&lt;BR /&gt;
1320642000&lt;BR /&gt;&lt;BR /&gt;
1320728400&lt;BR /&gt;&lt;BR /&gt;
1320814800  9392.988527&lt;BR /&gt;
1320901200  23420.692374&lt;BR /&gt;
1320987600  9222.176128&lt;BR /&gt;
1321074000  8878.713042&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Is it possible to convert the "_time" field to a user-friendly format?  I searched throught some of the other questions but none really addressed this specific question.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30412#M6155</guid>
      <dc:creator>steveirogers</dc:creator>
      <dc:date>2020-09-28T10:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30413#M6156</link>
      <description>&lt;P&gt;You can use the convert functions.&lt;BR /&gt;
see &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.4/SearchReference/Convert"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.4/SearchReference/Convert&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;example to convert and store in a new field&lt;BR /&gt;
| convert ctime(_time) as time | table _time time&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2011 17:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30413#M6156</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2011-12-07T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30414#M6157</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You could use strftime function for eval command to convert it. For example:&lt;BR /&gt;&lt;BR /&gt;
| eval human_readable_time=strftime(_time, "%Y-%d-%m %H:%M")&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30414#M6157</guid>
      <dc:creator>jaceknykis</dc:creator>
      <dc:date>2020-09-28T10:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30415#M6158</link>
      <description>&lt;P&gt;Jaceknykis and yannK, thank you both for responding to my query.   (I tried to respond sooner but I was having problems logging to SplunkAnswers.&lt;/P&gt;

&lt;P&gt;I tried both methods but the results did not change. &lt;BR /&gt;
The problem might be in what I am trying to do.  When I run the Saved Search manually in the browser, the results display correctly with formatted dates like this:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
11/13/11 12:00:00.000 AM 3007.768024 &lt;BR /&gt;
11/14/11 12:00:00.000 AM 2731.953137 &lt;BR /&gt;
11/15/11 12:00:00.000 AM 9833.730893 &lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;However, I have this Saved Search implemented to run on a schedule and to email the results.    The emailed results have the strangely formatted date like this:&lt;BR /&gt;
&lt;PRE&gt; &lt;BR /&gt;
1321160400  3007.768024&lt;BR /&gt;
1321246800  2731.953137&lt;BR /&gt;
1321333200  9833.730893&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Any thoughts?  Do I need to run some "conversion" on the output results instead?&lt;/P&gt;

&lt;P&gt;Thanks again for your response.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 15:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30415#M6158</guid>
      <dc:creator>steveirogers</dc:creator>
      <dc:date>2011-12-14T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30416#M6159</link>
      <description>&lt;P&gt;I have a similar search and I added | eval SpaceGB = Space/1048576 to my search and it seemed to work to convert my numbers to GB.  I had the same issue.  &lt;/P&gt;

&lt;P&gt;My entire search I have looks something like this:&lt;/P&gt;

&lt;P&gt;host="ynfs1" sourcetype=userdiskusage earliest=-1d | rex field=_raw "(?&amp;lt;Space&amp;gt;\d+)\s*\/home\/(?&amp;lt;UserName&amp;gt;\S+)" | search NOT UserName="shares" | eval SpaceGB = Space/1048576 | sort SpaceGB,UserName desc | head 20 | table UserName,SpaceGB&lt;/P&gt;

&lt;P&gt;This search sorts the data and puts it into a table.  Maybe try incorporating the | eval SpaceGB = Space/1048576 into your search and see if this makes a difference?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 15:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30416#M6159</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-12-14T15:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30417#M6160</link>
      <description>&lt;P&gt;Great.  Thanks gnovak, jaceknykis, yannK.  Problem solved.  It took portions of all of your responses.  First I used the &lt;EVAL display_time="strftime(_time,"&gt; to get the time a usable format, but the dates in my alert were still not readable.&lt;BR /&gt;
Then it dawned on me after reading gnovak's response that I was using the "timechart" function in my alert.  I converted the "timechart" to "table display_time, indexing_volume" and "magically" the dates in my alert are in the correct format.&lt;/EVAL&gt;&lt;/P&gt;

&lt;P&gt;Thanks very much for all you help and pointing me in the right direction.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30417#M6160</guid>
      <dc:creator>steveirogers</dc:creator>
      <dc:date>2020-09-28T10:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Splunk default time to human readable format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30418#M6161</link>
      <description>&lt;P&gt;cool!  glad it worked out!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 20:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Convert-Splunk-default-time-to-human-readable-format/m-p/30418#M6161</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-12-14T20:13:50Z</dc:date>
    </item>
  </channel>
</rss>

