<?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: tstats command by _time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635514#M220792</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response. But in my case there are no groups, because i used also another field (id) in by section, which is unique. So I expected to see all events with their original timestamps.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2023 15:52:58 GMT</pubDate>
    <dc:creator>LIS</dc:creator>
    <dc:date>2023-03-22T15:52:58Z</dc:date>
    <item>
      <title>Why does tstats command alter time stamps when I run it by _time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635498#M220786</link>
      <description>&lt;P&gt;I am wondering why tstats command alters time stamps when I run it by _time.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;| tstats values(text_len) as text_len&amp;nbsp; values(ts) as ts where index = data sourcetype = cdr by _time thread_id num_attempts&lt;/P&gt;
&lt;P&gt;raw data in index=data :&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Time&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&lt;A class="" href="https://bicssplunk.bc:8000/en-GB/app/dashboard_messaging/search?q=search%20index%20%3D%20data_sms%20sourcetype%20%3D%20openmind%3Asms%3Acdr&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=1679487252&amp;amp;latest=1679487258&amp;amp;display.events.timelineEarliestTime=1679487255.9&amp;amp;display.events.timelineLatestTime=1679487256.2&amp;amp;sid=1679491269.24533_DEB8EF48-6AAD-4570-8ED3-D2E0419DC73E#" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;_time&lt;/SPAN&gt;&lt;/A&gt;&lt;/TD&gt;
&lt;TD&gt;2023-03-22T13:14:16.000+01:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LIS_0-1679491403739.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24435i37247F2DB981C3E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LIS_0-1679491403739.png" alt="LIS_0-1679491403739.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After tstats:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2023-03-22 13:10:00&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LIS_1-1679491530559.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24436iC59AE1185160ED96/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LIS_1-1679491530559.png" alt="LIS_1-1679491530559.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 14:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635498#M220786</guid>
      <dc:creator>LIS</dc:creator>
      <dc:date>2023-03-23T14:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635513#M220791</link>
      <description>&lt;P&gt;To group events by _time, &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; rounds the _time value down to create groups based on the specified span.&amp;nbsp; If no span is specified, &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; will pick one that fits best in the time window search - 10 minutes in this case.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 15:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635513#M220791</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-03-22T15:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635514#M220792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response. But in my case there are no groups, because i used also another field (id) in by section, which is unique. So I expected to see all events with their original timestamps.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 15:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635514#M220792</guid>
      <dc:creator>LIS</dc:creator>
      <dc:date>2023-03-22T15:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635545#M220802</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; still would have modified the timestamps in anticipation of creating groups.&amp;nbsp; It wouldn't know that would fail until it was too late.&lt;/P&gt;&lt;P&gt;If this was a &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command then you could copy _time to another field for grouping, but I don't know of a way to do that with &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 18:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635545#M220802</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-03-22T18:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635590#M220813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240613"&gt;@LIS&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957" target="_blank" rel="noopener"&gt;@richgalloway&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; is correct, it's due to grouping by the _time field.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;If you do want to pull the original _time out of the event then do not group by _time but pull it out as a field value, e.g.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;| tstats max(_time) AS _time values(text_len) as text_len&amp;nbsp; values(ts) as ts where index = data sourcetype = cdr by thread_id num_attempts&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This assumes that each event has a unique&amp;nbsp;&lt;SPAN&gt;thread_id and num_attempts, but hopefully this demonstrates the difference in what you expected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 02:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635590#M220813</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-03-23T02:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635591#M220814</link>
      <description>&lt;P&gt;tstats by _time supports the span= argument, so you can do span=1s to get the a 1 second bucket of _time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 03:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/635591#M220814</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-03-23T03:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/700373#M237670</link>
      <description>&lt;P&gt;I ran into the same thing, but I noticed that when I run my queries against a data model that is not accellerated, I get the right results.&lt;/P&gt;&lt;P&gt;Is there a reason why running against a datamodel that is accelerated and the same data model that is not accelerated yield different results?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 18:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/700373#M237670</guid>
      <dc:creator>qs_chuy</dc:creator>
      <dc:date>2024-09-27T18:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: tstats command by _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/700375#M237671</link>
      <description>&lt;P&gt;This thread is more than a year old so you are more likely to get responses by submitting a new question.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 19:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/700375#M237671</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-09-27T19:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why does tstats command alter time stamps when I run it by _time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/709009#M239661</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;found out &lt;EM&gt;| tstats ... by source&lt;/EM&gt; provides less results than&lt;EM&gt; | tstats ... values(source)&lt;/EM&gt;&amp;nbsp; in a search combining a query joined with tstats &lt;span class="lia-unicode-emoji" title=":upside_down_face:"&gt;🙃&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats min(_time) as firstTime max(_time) as lastTime values(source) as source WHERE index=* by host,index provides ALL sources

| tstats min(_time) as firstTime max(_time) as lastTime WHERE index=* by host,index,source provides only 1 source&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 16 Jan 2025 17:40:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-does-tstats-command-alter-time-stamps-when-I-run-it-by-time/m-p/709009#M239661</guid>
      <dc:creator>splunkreal</dc:creator>
      <dc:date>2025-01-16T17:40:24Z</dc:date>
    </item>
  </channel>
</rss>

