<?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: formatting _time field into a YYYY-MM-DD field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185704#M53505</link>
    <description>&lt;P&gt;Use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Convert"&gt;convert&lt;/A&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | convert timeformat="%Y-%m-%d" ctime(_time) AS ctime | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use whatever &lt;CODE&gt;... AS yourfield&lt;/CODE&gt; you want, of course.&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2015 02:21:23 GMT</pubDate>
    <dc:creator>jtrucks</dc:creator>
    <dc:date>2015-05-12T02:21:23Z</dc:date>
    <item>
      <title>formatting _time field into a YYYY-MM-DD field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185701#M53502</link>
      <description>&lt;P&gt;This search is ok&lt;BR /&gt;
&lt;CODE&gt;... | stats max(fieldname1) as fn1 by _time&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;but I want to control the format of the _time field to be format to be YYYY-MM-DD&lt;/P&gt;

&lt;P&gt;How can I do this? &lt;/P&gt;

&lt;P&gt;I know i can do &lt;CODE&gt;... | timechart span=d max(fieldname1) as fn1&lt;/CODE&gt; but i am looking for another way as it relates to something I am working on and the timechart option won't work.&lt;/P&gt;

&lt;P&gt;I am think something like   &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | eval time_field=(_time,"YYYY-MM-DD")| stats max(fieldname1) as fn1 by time_field&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;Can this be done? &lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 20:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185701#M53502</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-11T20:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: formatting _time field into a YYYY-MM-DD field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185702#M53503</link>
      <description>&lt;P&gt;think this is what I want&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/94614/how-to-extract-date-yyyymmdd-from-time.html"&gt;http://answers.splunk.com/answers/94614/how-to-extract-date-yyyymmdd-from-time.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 21:17:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185702#M53503</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2015-05-11T21:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: formatting _time field into a YYYY-MM-DD field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185703#M53504</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;
... | eval time_field=strptime&lt;BR /&gt;
(_time,"%Y-%m-%d")|&lt;BR /&gt;
stats max(fieldname1)&lt;BR /&gt;
as fn1 by time_field&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185703#M53504</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2020-09-28T19:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: formatting _time field into a YYYY-MM-DD field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185704#M53505</link>
      <description>&lt;P&gt;Use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Convert"&gt;convert&lt;/A&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | convert timeformat="%Y-%m-%d" ctime(_time) AS ctime | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can use whatever &lt;CODE&gt;... AS yourfield&lt;/CODE&gt; you want, of course.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 02:21:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/formatting-time-field-into-a-YYYY-MM-DD-field/m-p/185704#M53505</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2015-05-12T02:21:23Z</dc:date>
    </item>
  </channel>
</rss>

