<?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: stats value(_time) delimiter in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335509#M99651</link>
    <description>&lt;P&gt;When those values come out of the initial &lt;CODE&gt;stats&lt;/CODE&gt; command, they are not delimited at all.  They are in a multivalue field, which will normally display as if it was newlines.  &lt;/P&gt;

&lt;P&gt;The field _time is special.  It is normally in epoch format, but presents itself in a data format.  When you do this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... the results in the multivalue field will be in epoch time values.&lt;/P&gt;

&lt;P&gt;If you rename it back to &lt;CODE&gt;_time&lt;/CODE&gt; like so...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(_time) as _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...then when the interface tries to present the value of &lt;CODE&gt;_time&lt;/CODE&gt;, it will realize that it is a multivalue field and present it in the comma-delimited form instead.  but the values will still be in epoch form.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 1509011713,1509011758,1509011764,1509011792...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The fact that you are showing date/times in human-readable form implies that you did something else before the &lt;CODE&gt;stats&lt;/CODE&gt; command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time = strftime(_time,"%F %H:%M:%S")
| stats values(_time) as _time

2017-10-26 09:57:52,2017-10-26 09:58:20,2017-10-26 09:58:21,2017-10-26 09:59:52...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you rename the result of the &lt;CODE&gt;values()&lt;/CODE&gt; to anything else but&lt;CODE&gt;_time&lt;/CODE&gt;, then it will remain in the plain epoch, plain multivalue form.   I believe this is what you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time = strftime(_time,"%F %H:%M:%S")
| stats values(_time) as Time

2017-10-26 10:00:02 
2017-10-26 10:00:03 
2017-10-26 10:00:06 
 ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Oct 2017 18:13:42 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-10-26T18:13:42Z</dc:date>
    <item>
      <title>stats value(_time) delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335508#M99650</link>
      <description>&lt;P&gt;When I use stats values(_time) as _time group by  the list of values in my table is delimitated by comma's. &lt;BR /&gt;
ex:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10/25/2017 16:48:34,10/25/2017 17:17:11,10/25/2017 17:17:15,10/25/2017 17:17:17,10/25/2017 17:19:02,10/25/2017 19:10:03,10/25/2017 19:20:15,10/25/2017 19:32:48,10/25/2017 20:02:20,10/25/2017 22:01:18,10/25/2017 23:02:41,10/26/2017 00:02:11,10/26/2017 00:02:31,10/26/2017 03:25:27
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I use stats values(ip_address) as ip_addresses group by  the list of values in my table is eliminated by new lines. &lt;BR /&gt;
ex: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;168.227.146.19
176.49.175.120
177.129.242.138
188.105.223.1
190.202.206.139
190.214.152.247
192.160.102.170
199.249.223.60
201.254.172.148
45.55.57.18
47.154.229.1
51.15.64.212
54.201.174.255
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I get consistency?  Preferably forcing the list of times to be delimited by the new line.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335508#M99650</guid>
      <dc:creator>bx_ben</dc:creator>
      <dc:date>2020-09-29T16:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: stats value(_time) delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335509#M99651</link>
      <description>&lt;P&gt;When those values come out of the initial &lt;CODE&gt;stats&lt;/CODE&gt; command, they are not delimited at all.  They are in a multivalue field, which will normally display as if it was newlines.  &lt;/P&gt;

&lt;P&gt;The field _time is special.  It is normally in epoch format, but presents itself in a data format.  When you do this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... the results in the multivalue field will be in epoch time values.&lt;/P&gt;

&lt;P&gt;If you rename it back to &lt;CODE&gt;_time&lt;/CODE&gt; like so...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(_time) as _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...then when the interface tries to present the value of &lt;CODE&gt;_time&lt;/CODE&gt;, it will realize that it is a multivalue field and present it in the comma-delimited form instead.  but the values will still be in epoch form.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 1509011713,1509011758,1509011764,1509011792...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The fact that you are showing date/times in human-readable form implies that you did something else before the &lt;CODE&gt;stats&lt;/CODE&gt; command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time = strftime(_time,"%F %H:%M:%S")
| stats values(_time) as _time

2017-10-26 09:57:52,2017-10-26 09:58:20,2017-10-26 09:58:21,2017-10-26 09:59:52...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you rename the result of the &lt;CODE&gt;values()&lt;/CODE&gt; to anything else but&lt;CODE&gt;_time&lt;/CODE&gt;, then it will remain in the plain epoch, plain multivalue form.   I believe this is what you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval _time = strftime(_time,"%F %H:%M:%S")
| stats values(_time) as Time

2017-10-26 10:00:02 
2017-10-26 10:00:03 
2017-10-26 10:00:06 
 ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Oct 2017 18:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335509#M99651</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-26T18:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: stats value(_time) delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335510#M99652</link>
      <description>&lt;P&gt;The results above are with | stats values(_time) as _time but still do not list the same way as stats values(ip_addresses) as ip_addresses. They show in this ,,, regardless if pre-modify the _time variable. &lt;/P&gt;

&lt;P&gt;My question is, why is only _time showing with , delimiter, all other values show up with new lines list.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335510#M99652</guid>
      <dc:creator>bx_ben</dc:creator>
      <dc:date>2020-09-29T16:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: stats value(_time) delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335511#M99653</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79883"&gt;@bx_ben&lt;/a&gt;  - there are lots of special things about internal fields like &lt;CODE&gt;_time&lt;/CODE&gt; -- I'll give you some examples in a minute.  When you do &lt;CODE&gt;values(_time)&lt;/CODE&gt; that is going to break most of them, so you might as well rename it to something else that won't confuse you and the system.  You don't NEED that multivalue field to be called &lt;CODE&gt;_time&lt;/CODE&gt;, so rename it during the &lt;CODE&gt;stats&lt;/CODE&gt; command and it will act as expected.   &lt;/P&gt;

&lt;P&gt;Okay, here's a list off the top of my head...&lt;/P&gt;

&lt;P&gt;1) &lt;CODE&gt;_time&lt;/CODE&gt; is the expected order of events, thus &lt;CODE&gt;latest()&lt;/CODE&gt; on a different field will compare the &lt;CODE&gt;_time&lt;/CODE&gt; fields on the two events in order to determine which one to present.&lt;/P&gt;

&lt;P&gt;2) &lt;CODE&gt;timechart&lt;/CODE&gt; implicitly uses &lt;CODE&gt;_time&lt;/CODE&gt;, and only &lt;CODE&gt;_time&lt;/CODE&gt;, for its x axis.   &lt;/P&gt;

&lt;P&gt;3) &lt;CODE&gt;_time&lt;/CODE&gt; is in epoch time but will automatically format itself on the output interface.  It is not precisely the same as another field that has been &lt;CODE&gt;convert&lt;/CODE&gt;ed to &lt;CODE&gt;ctime()&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335511#M99653</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-09-29T16:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: stats value(_time) delimiter</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335512#M99654</link>
      <description>&lt;P&gt;I just had to do this ... and discovered that this worked for me:&lt;/P&gt;

&lt;P&gt;After the |stats values(_time) as _time, then...&lt;/P&gt;

&lt;P&gt;| makemv delim="," _time&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2019 22:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-value-time-delimiter/m-p/335512#M99654</guid>
      <dc:creator>wryanthomas</dc:creator>
      <dc:date>2019-09-02T22:03:47Z</dc:date>
    </item>
  </channel>
</rss>

