<?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 How to get time value into summary index data? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317290#M2739</link>
    <description>&lt;P&gt;I am currently generating a summary index using the following saved search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mail | sistats count as sbj_count by subject
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which I am accessing it using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;summaryindex=myindex report=report_for_this_search | stats count as sbj_count by subject
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works however I need an _time value which this does not have. I try to create one by changing the saved search, based on the documentation for summary indexing without a timestamp to  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mail | sistats count as sbj_count by subject | eval _time=now()
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and accessing it using&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;summaryindex=myindex report=report_for_this_search | stats count as sbj_count by subject | eval _time=now() | table _time,subject,sbj_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which produces the _time values as the time of my search rather than the time of the search which generated the summary index. How do I get the _time value to be the time that the summary index event ran rather than when I searched the summary index?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 18:12:51 GMT</pubDate>
    <dc:creator>jamessteel</dc:creator>
    <dc:date>2017-04-10T18:12:51Z</dc:date>
    <item>
      <title>How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317290#M2739</link>
      <description>&lt;P&gt;I am currently generating a summary index using the following saved search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mail | sistats count as sbj_count by subject
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which I am accessing it using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;summaryindex=myindex report=report_for_this_search | stats count as sbj_count by subject
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works however I need an _time value which this does not have. I try to create one by changing the saved search, based on the documentation for summary indexing without a timestamp to  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mail | sistats count as sbj_count by subject | eval _time=now()
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and accessing it using&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;summaryindex=myindex report=report_for_this_search | stats count as sbj_count by subject | eval _time=now() | table _time,subject,sbj_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which produces the _time values as the time of my search rather than the time of the search which generated the summary index. How do I get the _time value to be the time that the summary index event ran rather than when I searched the summary index?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 18:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317290#M2739</guid>
      <dc:creator>jamessteel</dc:creator>
      <dc:date>2017-04-10T18:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317291#M2740</link>
      <description>&lt;P&gt;Try adding _time to the by clause in your sistats command:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=mail | sistats count as sbj_count by subject, _time&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;To test it out first, just use the regular stats command to ensure you get what you expect:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=mail | stats count as sbj_count by subject, _time&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Depending on what your data looks like you may have multiple timestamps to deal with, so something like &lt;CODE&gt;| stats max(_time) AS _time&lt;/CODE&gt; may also be helpful if you want the last timestamp. Would likely then need to convert the epoch to human readable. Really depends what the data looks like and what your desired outcome is. Feel free to post a couple example events to allow us to help further. &lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 18:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317291#M2740</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-04-10T18:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317292#M2741</link>
      <description>&lt;P&gt;Change your summary index search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mail | eval _time=now() | sistats count as sbj_count by subject _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And access it like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex report=report_for_this_search | stats count as sbj_count by subject _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Apr 2017 18:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317292#M2741</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-10T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317293#M2742</link>
      <description>&lt;P&gt;Thank you for the response, this would work for most people who are trying to group by the time of the event, and works if I trasnform the time using the command given below. Thank you for the response though!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317293#M2742</guid>
      <dc:creator>jamessteel</dc:creator>
      <dc:date>2017-04-10T19:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317294#M2743</link>
      <description>&lt;P&gt;Thank you, this worked well. This method of doing it makes more sense now that I think about it.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 19:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317294#M2743</guid>
      <dc:creator>jamessteel</dc:creator>
      <dc:date>2017-04-10T19:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get time value into summary index data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317295#M2744</link>
      <description>&lt;P&gt;ah! I re-read your post and see what you mean now! Glad Somesoni2 got you sorted!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-get-time-value-into-summary-index-data/m-p/317295#M2744</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-04-10T20:59:43Z</dc:date>
    </item>
  </channel>
</rss>

