<?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: How to convert my date and time field into a human readable format? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281648#M53859</link>
    <description>&lt;P&gt;Get rid of your quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count | fields - count | eval StartTime="2017-02-05T10:02:00.000-0800"
| fieldformat StartTime=strftime(strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N%z"),"%m-%d-%Y %H:%M %p")
| table StartTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Feb 2017 04:19:51 GMT</pubDate>
    <dc:creator>splunker1981</dc:creator>
    <dc:date>2017-02-08T04:19:51Z</dc:date>
    <item>
      <title>How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281643#M53854</link>
      <description>&lt;P&gt;First, I read similar Question/Answers and was able to follow them for other time formats. These work well but didn't address the specific format my timestamp is in.&lt;/P&gt;

&lt;P&gt;Use Case:&lt;BR /&gt;
I have a field called "StartTime" and it has time in the following format: 2017-02-05T10:02:00.000-0800 &lt;/P&gt;

&lt;P&gt;I would like this to be converted for all fields so that when I table "StartTime" I get human readable format. I will be doing the same conversion for a field called "EndTime" which is in the same format.&lt;/P&gt;

&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281643#M53854</guid>
      <dc:creator>aaronevil</dc:creator>
      <dc:date>2017-02-07T22:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281644#M53855</link>
      <description>&lt;P&gt;What do you mean by human readable, can you provide an example of what you'd like the end result to look like&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281644#M53855</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2017-02-07T22:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281645#M53856</link>
      <description>&lt;P&gt;Something similar to "2-5-2017 10:02 AM" for the example listed above.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:21:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281645#M53856</guid>
      <dc:creator>aaronevil</dc:creator>
      <dc:date>2017-02-07T22:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281646#M53857</link>
      <description>&lt;P&gt;It's already in human-readable format, but if you want to change the format try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fieldformat StartTime=strftime(strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N%z"), "%m-%d-%Y %H:%M %p") | fieldformat EndTime=strftime(strptime(EndTime,"%Y-%m-%dT%H:%M:%S.%3N%z"), "%m-%d-%Y %H:%M %p") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281646#M53857</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-07T22:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281647#M53858</link>
      <description>&lt;P&gt;This is actually along the lines of what I was trying initially. When I use fieldformat with strf and strp it removes all data from that field when I table it.&lt;/P&gt;

&lt;P&gt;index="my_index"&lt;BR /&gt;
| dedup key&lt;BR /&gt;
| search key!=""&lt;BR /&gt;
| fieldformat "StartTime"=strftime(strptime("StartTime","%Y-%m-%dT%H:%M:%S.%3N%z"), "%m-%d-%Y %H:%M %p")&lt;BR /&gt;
| table key Summary StartTime&lt;/P&gt;

&lt;P&gt;Results in StartTime being empty within the table.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 22:58:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281647#M53858</guid>
      <dc:creator>aaronevil</dc:creator>
      <dc:date>2017-02-07T22:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281648#M53859</link>
      <description>&lt;P&gt;Get rid of your quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count | fields - count | eval StartTime="2017-02-05T10:02:00.000-0800"
| fieldformat StartTime=strftime(strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N%z"),"%m-%d-%Y %H:%M %p")
| table StartTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 04:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281648#M53859</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2017-02-08T04:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my date and time field into a human readable format?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281649#M53860</link>
      <description>&lt;P&gt;Doh. Always the little things. I appreciate the additional eyes.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 22:50:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-convert-my-date-and-time-field-into-a-human-readable/m-p/281649#M53860</guid>
      <dc:creator>aaronevil</dc:creator>
      <dc:date>2017-02-08T22:50:56Z</dc:date>
    </item>
  </channel>
</rss>

