<?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: Group transactions per day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69414#M17404</link>
    <description>&lt;P&gt;I am having a hard time following this. I would probably simplify it like this, for a start&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=EDR user=* 
| dedup LoadTime, user, _time 
| bucket _time span=1d
| stats sum(LoadTime) as UserLoadTime by _time user
| eventstats sum(UserLoadTime)  as TotalLoadTime by _time
| fieldformat UserLoadTime = tostring(UserLoadTime,"duration")
| fieldformat TotalLoadTime = tostring(TotalLoadTime,"duration")
| eval Day = strftime(_time,"%x")
| rename user as User
| table Day TotalLoadTime User UserLoadTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am unsure of the need for the dedup, unless you have duplicate data in your index.&lt;/P&gt;

&lt;P&gt;If you want a slightly different format, try this (it's a little weird, but it should work):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=EDR user=* 
| dedup LoadTime, user, _time 
| bucket _time span=1d
| stats sum(LoadTime) as UserLoadTime by _time user
| eventstats sum(UserLoadTime)  as TotalLoadTime by _time
| fieldformat TotalLoadTime = tostring(TotalLoadTime,"duration")
| eval Day = strftime(_time,"%x")
| eval UserPlusTime = user + ": " + tostring(UserLoadTime,"duration")
| stats last(TotalLoadTime) as "Total Seconds"  values(UserPlusTime) as "User: LoadTime" by Day
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Dec 2012 05:33:01 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-12-20T05:33:01Z</dc:date>
    <item>
      <title>Group transactions per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69413#M17403</link>
      <description>&lt;P&gt;I have this search which works great.  It makes a list for me of load times for each user, and then a total of all time (basically adding up all user times and giving me a total).  This search works amazing for 24 hours time. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=EDR user=* 
| dedup LoadTime, user 
| stats count by LoadTime,user,_time | fields - count 
| transaction maxspan=24h 
| convert dur2sec(LoadTime) AS LoadTimeSec 
| eventstats sum(LoadTimeSec) as "TotalSec" 
| convert timeformat="%H:%M:%S" ctime(TotalSec) AS Total_Time 
| fields LoadTime, user, Total_Time 
| fields - _raw, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However switching to say, 7 days doesn't work so good.  For 7 days I would like to have a list of 7 events, and each event would contain the list of the load times for each user, the users, and the total load time.  &lt;/P&gt;

&lt;P&gt;How can I tell splunk to give me 7 days of this data separated like this?  It's instead giving me a jumbled list.  Would "span" work on this?  So far I haven't gotten it to work.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 22:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69413#M17403</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-12-19T22:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Group transactions per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69414#M17404</link>
      <description>&lt;P&gt;I am having a hard time following this. I would probably simplify it like this, for a start&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=EDR user=* 
| dedup LoadTime, user, _time 
| bucket _time span=1d
| stats sum(LoadTime) as UserLoadTime by _time user
| eventstats sum(UserLoadTime)  as TotalLoadTime by _time
| fieldformat UserLoadTime = tostring(UserLoadTime,"duration")
| fieldformat TotalLoadTime = tostring(TotalLoadTime,"duration")
| eval Day = strftime(_time,"%x")
| rename user as User
| table Day TotalLoadTime User UserLoadTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am unsure of the need for the dedup, unless you have duplicate data in your index.&lt;/P&gt;

&lt;P&gt;If you want a slightly different format, try this (it's a little weird, but it should work):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=EDR user=* 
| dedup LoadTime, user, _time 
| bucket _time span=1d
| stats sum(LoadTime) as UserLoadTime by _time user
| eventstats sum(UserLoadTime)  as TotalLoadTime by _time
| fieldformat TotalLoadTime = tostring(TotalLoadTime,"duration")
| eval Day = strftime(_time,"%x")
| eval UserPlusTime = user + ": " + tostring(UserLoadTime,"duration")
| stats last(TotalLoadTime) as "Total Seconds"  values(UserPlusTime) as "User: LoadTime" by Day
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2012 05:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69414#M17404</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-20T05:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Group transactions per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69415#M17405</link>
      <description>&lt;P&gt;This is working.  I added something to first convert time to seconds then convert it back to normal time for a sum.  I would love to only have TotalLoadTime displayed once for each day (sum of userloadtime for 1 day and put in totalloadtime once).  I'm still looking into this but this certainly is more on the track I was trying to go.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 21:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69415#M17405</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-12-20T21:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Group transactions per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69416#M17406</link>
      <description>&lt;P&gt;btw thank you.  I read about the bucket command for a while but wasn't sure if that would help.  There's always many options&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 21:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69416#M17406</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-12-20T21:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Group transactions per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69417#M17407</link>
      <description>&lt;P&gt;Also I like this, but I'm not sure it's as nice as Transaction.  With transaction, it's taking everything I mentioned and putting it as 1 result for 243 hours.  For 7 days I'd like to get 7 results, but I get 70 right now.  I am going to see if I can work transaction in there.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 22:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-transactions-per-day/m-p/69417#M17407</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-12-20T22:04:24Z</dc:date>
    </item>
  </channel>
</rss>

