<?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 change format for _time field values to display in timechart report? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112252#M29482</link>
    <description>&lt;P&gt;Sorry, I forgot about that. I updated my answer above, so that hopefully it will work now. (I even tested it.)&lt;/P&gt;</description>
    <pubDate>Fri, 05 Sep 2014 00:36:35 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2014-09-05T00:36:35Z</dc:date>
    <item>
      <title>How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112247#M29477</link>
      <description>&lt;P&gt;Hi, I am trying to create a timechart report and I want to manipulate the output of the _time field so instead of reading 8/28/14 12:00:00.000 AM that, for example, I can see 8/28/14 or Thursday. Anyone know how to do this? I am not referencing the _time field so removing/modifying it seems tough. This is the last piece of the 7 day search:&lt;/P&gt;

&lt;P&gt;index="pan_logs" | timechart span=1d dc(src_user) as "Source" BY firewall&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Paul&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112247#M29477</guid>
      <dc:creator>pbernardin</dc:creator>
      <dc:date>2020-09-28T17:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112248#M29478</link>
      <description>&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; implicitly references the &lt;CODE&gt;_time&lt;/CODE&gt; field, always. BUT you can't do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="pan_logs" 
| timechart span=1d dc(src_user) as "Source" BY firewall
| eval _time = strftime(_time,"%A")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry, I thought that would work. But you can't assign a new value to the built-in &lt;CODE&gt;_time&lt;/CODE&gt; field. Solution? Make your &lt;EM&gt;own&lt;/EM&gt; time field! Here is how:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="pan_logs"  
| bucket _time span=1d 
| stats dc(src_user) as "Source" BY firewall
| eval newTime = strftime(_time,"%x") 
| xyseries newTime firewall Source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How this works: first it groups the &lt;CODE&gt;_time&lt;/CODE&gt; variable by day, which you did with &lt;CODE&gt;timechart&lt;/CODE&gt; before. Then it computes your &lt;CODE&gt;Source&lt;/CODE&gt; statistic, but using the &lt;CODE&gt;stats&lt;/CODE&gt; command. The &lt;CODE&gt;eval&lt;/CODE&gt; creates the new timestamp. (Use whatever time format you like. &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Commontimeformatvariables"&gt;Common Time Format Variables&lt;/A&gt; has more info about your options.) The last step reformats the results of the &lt;CODE&gt;stats&lt;/CODE&gt; command so it will show up in a chart the way you want.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 19:50:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112248#M29478</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-09-04T19:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112249#M29479</link>
      <description>&lt;P&gt;awesome. Thank you so much&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 20:31:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112249#M29479</guid>
      <dc:creator>pbernardin</dc:creator>
      <dc:date>2014-09-04T20:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112250#M29480</link>
      <description>&lt;P&gt;actually i spoke too soon. When I tried this, my time formats were not changed, even after trying multiple variables / formats like %A , %a , etc... Maybe I need the eval in a different place? Any other ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 20:59:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112250#M29480</guid>
      <dc:creator>pbernardin</dc:creator>
      <dc:date>2014-09-04T20:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112251#M29481</link>
      <description>&lt;P&gt;try this:&lt;BR /&gt;
eval n=strptime(_time," %Y-%m-%d")&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 23:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112251#M29481</guid>
      <dc:creator>Heff</dc:creator>
      <dc:date>2014-09-04T23:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112252#M29482</link>
      <description>&lt;P&gt;Sorry, I forgot about that. I updated my answer above, so that hopefully it will work now. (I even tested it.)&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2014 00:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112252#M29482</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-09-05T00:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to change format for _time field values to display in timechart report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112253#M29483</link>
      <description>&lt;P&gt;Good suggestion.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2014 00:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-format-for-time-field-values-to-display-in/m-p/112253#M29483</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-09-05T00:37:33Z</dc:date>
    </item>
  </channel>
</rss>

