<?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 Streamstats Time Sum When Specific Values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472553#M132987</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm stumped on the following search.  The scenario is I'm trying to track the amount of time a support ticket is assigned to a support team and specific status, for the lifecycle of the ticket.  The following |streamstats works great, assuming the ticket doesn't get assigned to the same team and status twice.  (getting assigned out and back in)  It currently sums the time between.  Again, I only want to sum the time in a team and status, not including the time between where it goes out.&lt;/P&gt;

&lt;P&gt;|dedup ticket_id,_time,ticket_arvig_status&lt;BR /&gt;
|eval temp2=id+","+ticket_status&lt;BR /&gt;
|search (ticket_team="TIER 2" AND ticket_status="tier 2 needed"&lt;BR /&gt;
|streamstats range(_time) AS StatusDuration by ticket_id global=f window=2&lt;BR /&gt;
|stats sum(StatusDuration) AS TotalStatusDuration by ticket_id, ticket_status, ticket_team&lt;BR /&gt;
|stats avg(TotalStatusDuration) as averageage by ticket_id&lt;/P&gt;

&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:12:40 GMT</pubDate>
    <dc:creator>mikepangrac</dc:creator>
    <dc:date>2020-09-30T04:12:40Z</dc:date>
    <item>
      <title>Streamstats Time Sum When Specific Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472553#M132987</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm stumped on the following search.  The scenario is I'm trying to track the amount of time a support ticket is assigned to a support team and specific status, for the lifecycle of the ticket.  The following |streamstats works great, assuming the ticket doesn't get assigned to the same team and status twice.  (getting assigned out and back in)  It currently sums the time between.  Again, I only want to sum the time in a team and status, not including the time between where it goes out.&lt;/P&gt;

&lt;P&gt;|dedup ticket_id,_time,ticket_arvig_status&lt;BR /&gt;
|eval temp2=id+","+ticket_status&lt;BR /&gt;
|search (ticket_team="TIER 2" AND ticket_status="tier 2 needed"&lt;BR /&gt;
|streamstats range(_time) AS StatusDuration by ticket_id global=f window=2&lt;BR /&gt;
|stats sum(StatusDuration) AS TotalStatusDuration by ticket_id, ticket_status, ticket_team&lt;BR /&gt;
|stats avg(TotalStatusDuration) as averageage by ticket_id&lt;/P&gt;

&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472553#M132987</guid>
      <dc:creator>mikepangrac</dc:creator>
      <dc:date>2020-09-30T04:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Streamstats Time Sum When Specific Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472554#M132988</link>
      <description>&lt;P&gt;I'm not sure &lt;CODE&gt;not including the time between where it goes out.&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TotalStatusDuration&lt;/CODE&gt; ?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2020 00:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472554#M132988</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-15T00:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Streamstats Time Sum When Specific Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472555#M132989</link>
      <description>&lt;P&gt;you cant &lt;CODE&gt;range&lt;/CODE&gt; _time by ticket_id because you already &lt;CODE&gt;dedup&lt;/CODE&gt;ed the ticket_id ... &lt;BR /&gt;
meaning, you have only a single event (and therefore a single _time) for each ticket_id &lt;BR /&gt;
can you share sample data and desired results?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Streamstats-Time-Sum-When-Specific-Values/m-p/472555#M132989</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-09-30T04:07:07Z</dc:date>
    </item>
  </channel>
</rss>

