<?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 can I display _time in my results using stats command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585656#M204052</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234705"&gt;@EvansB&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to use _time for grouping events or as a field to display?&lt;/P&gt;&lt;P&gt;in the first case you could use the hint of&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229101"&gt;@tshah-splunk&lt;/a&gt;&amp;nbsp;, but is useful to add a bin command before the stats to group results, otherwise you'll have too many results:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=1d
| stats values(*) as * by _time &lt;/LI-CODE&gt;&lt;P&gt;if instead you need to display _time as a field, you can put it in the stats options, using some function:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;values(to have all the distinct values of _time,&lt;/LI&gt;&lt;LI&gt;earliest to have the first value,&lt;/LI&gt;&lt;LI&gt;latest to have the latest value.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In both situations, you have also, at the end, to convert _time from epochtime to human readable format using strftime.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 06:59:33 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-02-18T06:59:33Z</dc:date>
    <item>
      <title>How can I display _time in my results using stats command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585643#M204046</link>
      <description>&lt;P&gt;How can I display _time in my results using stats command&lt;BR /&gt;I get this field when I use "table _time"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EvansB_1-1645128730320.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18029iE80F9180EA3F7F9B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EvansB_1-1645128730320.png" alt="EvansB_1-1645128730320.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Just like the image above, I want to get the time field using stats and/or eval command&lt;BR /&gt;The image below is how my time events look like.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EvansB_0-1645124157881.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18028i2A2983DF1892AAF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EvansB_0-1645124157881.png" alt="EvansB_0-1645124157881.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 01:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585643#M204046</guid>
      <dc:creator>EvansB</dc:creator>
      <dc:date>2022-02-18T01:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display _time in my results using stats command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585651#M204049</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234705"&gt;@EvansB&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can simply use the below query to get the time field displayed in the stats table&lt;/P&gt;&lt;PRE&gt;| stats values(time) as time by _time&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Here, I&amp;nbsp; have kept _time and time as two different fields as the image displays time as a separate field. If both time and _time are the same fields, then it should not be a problem using either. But if they are different fields, and you want to use _time, then you can replace _time with time in the values function.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 05:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585651#M204049</guid>
      <dc:creator>tshah-splunk</dc:creator>
      <dc:date>2022-02-18T05:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I display _time in my results using stats command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585656#M204052</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234705"&gt;@EvansB&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want to use _time for grouping events or as a field to display?&lt;/P&gt;&lt;P&gt;in the first case you could use the hint of&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229101"&gt;@tshah-splunk&lt;/a&gt;&amp;nbsp;, but is useful to add a bin command before the stats to group results, otherwise you'll have too many results:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| bin _time span=1d
| stats values(*) as * by _time &lt;/LI-CODE&gt;&lt;P&gt;if instead you need to display _time as a field, you can put it in the stats options, using some function:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;values(to have all the distinct values of _time,&lt;/LI&gt;&lt;LI&gt;earliest to have the first value,&lt;/LI&gt;&lt;LI&gt;latest to have the latest value.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In both situations, you have also, at the end, to convert _time from epochtime to human readable format using strftime.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 06:59:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-display-time-in-my-results-using-stats-command/m-p/585656#M204052</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-18T06:59:33Z</dc:date>
    </item>
  </channel>
</rss>

