<?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: Put stats(values) and stats(count) in the same table (with tstats) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425682#M122028</link>
    <description>&lt;P&gt;Does this work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true count from datamodel=Authentication.Authentication where Authentication.action="failure" by Authentication.user 
| append 
    [| tstats summariesonly=true allow_old_summaries=true values from datamodel=Authentication.Authentication where Authentication.action=failure by _time Authentication.user Authentication.src Authentication.dest Authentication.app]
| `truncate_name("Authentication")` 
| eval Time = strftime(_time, "%d-%b-%Y %H:%M:%S") 
| stats values(Time) as Time values(app) as "App"  values(dest) as "Destination" values(src) as "Source" sum(count) by user
| rename user AS User
| sort -Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Mar 2019 20:22:52 GMT</pubDate>
    <dc:creator>chrisyounger</dc:creator>
    <dc:date>2019-03-07T20:22:52Z</dc:date>
    <item>
      <title>Put stats(values) and stats(count) in the same table (with tstats)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425681#M122027</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I need help with a dashboard Panel I need to make for a client. This guy wants a failed logins table, but merging it  with a a count of the same data for each user. My data is coming from an accelerated datamodel so I have to use tstats.&lt;/P&gt;

&lt;P&gt;Let me give you an example of what I need to do:&lt;/P&gt;

&lt;P&gt;I need to merge this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true count from datamodel=Authentication.Authentication where   Authentication.action="failure"   by Authentication.user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true values from datamodel=Authentication.Authentication where   Authentication.action=failure  by _time  Authentication.user Authentication.src Authentication.dest Authentication.app
|`truncate_name("Authentication")`
| eval Time = strftime(_time, "%d-%b-%Y %H:%M:%S")
| table Time  user app dest src
| rename user AS User src AS From dest AS "Destination" app AS "App"
| sort -Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in the same table.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 20:17:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425681#M122027</guid>
      <dc:creator>3DGjos</dc:creator>
      <dc:date>2019-03-07T20:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Put stats(values) and stats(count) in the same table (with tstats)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425682#M122028</link>
      <description>&lt;P&gt;Does this work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true count from datamodel=Authentication.Authentication where Authentication.action="failure" by Authentication.user 
| append 
    [| tstats summariesonly=true allow_old_summaries=true values from datamodel=Authentication.Authentication where Authentication.action=failure by _time Authentication.user Authentication.src Authentication.dest Authentication.app]
| `truncate_name("Authentication")` 
| eval Time = strftime(_time, "%d-%b-%Y %H:%M:%S") 
| stats values(Time) as Time values(app) as "App"  values(dest) as "Destination" values(src) as "Source" sum(count) by user
| rename user AS User
| sort -Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 20:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425682#M122028</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-03-07T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Put stats(values) and stats(count) in the same table (with tstats)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425683#M122029</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=true allow_old_summaries=true values
FROM datamodel=Authentication.Authentication 
WHERE nodename=Authentication.Failed_Authentication 
BY _time Authentication.user Authentication.src Authentication.dest Authentication.app 
| rename Authentication.* AS *
| rename _time AS Time
| fieldformat Time = strftime(Time, "%d-%b-%Y %H:%M:%S") 
| rename user AS User src AS From dest AS Destination app AS App
| table Time User App Destination From 
| sort 0 -Time
| eventstats count AS TotalForThisUser BY User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 03:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425683#M122029</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-08T03:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Put stats(values) and stats(count) in the same table (with tstats)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425684#M122030</link>
      <description>&lt;P&gt;Hello, sorry for the delay. I took your query and it worked, then my client changed the requirement and I had to go with something like woodcock did.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425684#M122030</guid>
      <dc:creator>3DGjos</dc:creator>
      <dc:date>2019-04-25T14:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Put stats(values) and stats(count) in the same table (with tstats)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425685#M122031</link>
      <description>&lt;P&gt;Hey, I managed to do it this way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex action=failure

   | eval "Time"=strftime(_time, "%d/%m/%Y %H:%M:%S")
   | eval "accesstype" =`mymacro(1)`
     | table Time "accesstype" user action app src dest
  |  rename myrenames

     | eventstats count AS "Total by destination" BY src, user
     | sort - "Total by destination"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 14:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Put-stats-values-and-stats-count-in-the-same-table-with-tstats/m-p/425685#M122031</guid>
      <dc:creator>3DGjos</dc:creator>
      <dc:date>2019-04-25T14:16:50Z</dc:date>
    </item>
  </channel>
</rss>

