<?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: Help with Timechart command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615248#M213814</link>
    <description>&lt;P&gt;timechart requires the _time field being in the dataset sent to it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That field doesn't exist once you do :&lt;/P&gt;&lt;PRE&gt;| stats avg(ttt) as avg_ttt&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You also cant chart a string value. Your `uptime2String()` macro means you no longer have a value that can be compared in a chart.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Sep 2022 16:52:09 GMT</pubDate>
    <dc:creator>andrew_nelson</dc:creator>
    <dc:date>2022-09-29T16:52:09Z</dc:date>
    <item>
      <title>Help with Timechart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615243#M213812</link>
      <description>&lt;P&gt;I have an SPL which gives a result. I want to get a trend of the result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried using timechart command, but it is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats `summariesonly` earliest(_time) as _time from datamodel=Incident_Management.Notable_Events_Meta by source,Notable_Events_Meta.rule_id | `drop_dm_object_name("Notable_Events_Meta")` | `get_correlations` | join rule_id [| from inputlookup:incident_review_lookup | eval _time=time | stats earliest(_time) as review_time by rule_id] | eval ttt=review_time-_time | stats avg(ttt) as avg_ttt | sort - avg_ttt | `uptime2string(avg_ttt, avg_ttt)` | rename *_ttt* as *(Time_To_Triage)* | fields - *_dec |table avg(Time_To_Triage) |rename avg(Time_To_Triage) as "Mean/Average Time To Respond"&lt;/LI-CODE&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="alexspunkshell_0-1664468944627.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21774iAC536505551073DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alexspunkshell_0-1664468944627.png" alt="alexspunkshell_0-1664468944627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:29:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615243#M213812</guid>
      <dc:creator>alexspunkshell</dc:creator>
      <dc:date>2022-09-29T16:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Timechart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615248#M213814</link>
      <description>&lt;P&gt;timechart requires the _time field being in the dataset sent to it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That field doesn't exist once you do :&lt;/P&gt;&lt;PRE&gt;| stats avg(ttt) as avg_ttt&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You also cant chart a string value. Your `uptime2String()` macro means you no longer have a value that can be compared in a chart.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 16:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615248#M213814</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2022-09-29T16:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Timechart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615474#M213892</link>
      <description>&lt;P&gt;If you want to use timechart, your _time cannot be a single value such as earliest(_time) will give. (Besides, min(_time) is more efficient than earliest(_time).) &amp;nbsp;With tstats, you need to chop off _time the same way you want timechart to chop off time into intervals. &amp;nbsp;Say, you want to have 5-minute intervals,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats `summariesonly` from datamodel=Incident_Management.Notable_Events_Meta by source,Notable_Events_Meta.rule_id _time span=5m
| `drop_dm_object_name("Notable_Events_Meta")`
| `get_correlations`
| join rule_id 
    [| from inputlookup:incident_review_lookup
    | eval _time=time
    | stats earliest(_time) as review_time by rule_id]
| eval ttt=review_time-_time
| timechart span=5m avg(ttt) as avg_ttt
| sort - avg_ttt
| `uptime2string(avg_ttt, avg_ttt)`
| rename *_ttt* as *(Time_To_Triage)*
| fields - *_dec
| table avg(Time_To_Triage)
| rename avg(Time_To_Triage) as "Mean/Average Time To Respond"&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 01 Oct 2022 01:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-Timechart-command/m-p/615474#M213892</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-01T01:22:44Z</dc:date>
    </item>
  </channel>
</rss>

