<?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: Timechart with sum at single value level in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305601#M91723</link>
    <description>&lt;P&gt;This is an option,&lt;BR /&gt;
but I'd like to get a tabular output, like&lt;/P&gt;

&lt;P&gt;incident duration AppID Weekly_Inc_duration&lt;/P&gt;

&lt;P&gt;in order to have the chance afterwards to append some further column and import this search as DataSet for further processing.&lt;/P&gt;

&lt;P&gt;Tks!&lt;BR /&gt;
Carmine&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:38:55 GMT</pubDate>
    <dc:creator>CarmineCalo</dc:creator>
    <dc:date>2020-09-29T17:38:55Z</dc:date>
    <item>
      <title>Timechart with sum at single value level</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305599#M91721</link>
      <description>&lt;P&gt;Splunkers!&lt;BR /&gt;
Need your help...&lt;/P&gt;

&lt;P&gt;I created a search piping the following fields (simplified)&lt;/P&gt;

&lt;P&gt;_time  AppID  Incident_duration&lt;/P&gt;

&lt;P&gt;I have to group incidents duration by week, running a timechart, at AppID level:&lt;/P&gt;

&lt;P&gt;| timechart span=1w values(AppID) as AppID, sum(incident_duration) as Weekly_Inc_duration&lt;/P&gt;

&lt;P&gt;Unfortunately, returned AppID field is a multivaluefield (whenever in the same week there are multiple AppID with an incident event) and in this case Weekly_Inc_duration is the sum of the duration for all those AppIDs.&lt;BR /&gt;
I'd like to get as output the sum at AppID level.&lt;/P&gt;

&lt;P&gt;Can you help me?&lt;/P&gt;

&lt;P&gt;Tks!&lt;BR /&gt;
CArmine&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305599#M91721</guid>
      <dc:creator>CarmineCalo</dc:creator>
      <dc:date>2020-09-29T17:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with sum at single value level</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305600#M91722</link>
      <description>&lt;P&gt;Do you mean like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart span=1w sum(incident_duration) as Weekly_Inc_duration BY AppID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Jan 2018 23:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305600#M91722</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-13T23:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with sum at single value level</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305601#M91723</link>
      <description>&lt;P&gt;This is an option,&lt;BR /&gt;
but I'd like to get a tabular output, like&lt;/P&gt;

&lt;P&gt;incident duration AppID Weekly_Inc_duration&lt;/P&gt;

&lt;P&gt;in order to have the chance afterwards to append some further column and import this search as DataSet for further processing.&lt;/P&gt;

&lt;P&gt;Tks!&lt;BR /&gt;
Carmine&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305601#M91723</guid>
      <dc:creator>CarmineCalo</dc:creator>
      <dc:date>2020-09-29T17:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with sum at single value level</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305602#M91724</link>
      <description>&lt;P&gt;Probably i found the solution&lt;BR /&gt;
Timechart was the wrong way to create the dataset i was looking for.&lt;/P&gt;

&lt;P&gt;I add within the search the calculation of fa field, dateweek_year, extracting Year+Week from _time&lt;BR /&gt;
Than i simply run the stats command, in this way&lt;/P&gt;

&lt;P&gt;| stats sum(incident_unavailability) as Unavailability by dateweek_year, CI&lt;/P&gt;

&lt;P&gt;It seems to work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305602#M91724</guid>
      <dc:creator>CarmineCalo</dc:creator>
      <dc:date>2020-09-29T17:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart with sum at single value level</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305603#M91725</link>
      <description>&lt;P&gt;hey&lt;/P&gt;

&lt;P&gt;looking at your comments section you can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval dateyearweek=strftime(_time,"%Y-%U") | stats  sum(incident_duration) as Weekly_Inc_duration BY AppID dateyearweek
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending of your country, you have 2 variations :&lt;/P&gt;

&lt;P&gt;%U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number [00,53].&lt;/P&gt;

&lt;P&gt;%V is replaced by the week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1.&lt;/P&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jan 2018 08:45:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-sum-at-single-value-level/m-p/305603#M91725</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-14T08:45:06Z</dc:date>
    </item>
  </channel>
</rss>

