<?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 tstats and eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-with-tstats-and-eval/m-p/454614#M128608</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index=cisco AND sourcetype="cisco:asa" BY splunk_server _time span=1d
| eval splunk_region = case(
   like(splunk_server,"%bos-%"),  "BOS", 
   like(splunk_server, "dfw-%"),  "DFW",
   like(splunk_server, "%lax-%"), "LAX", 
   true(),                        "OTHER") 
| timechart span=1d sum(count) AS count BY splunk_region
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Aug 2019 15:21:33 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-08-20T15:21:33Z</dc:date>
    <item>
      <title>help with tstats and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-tstats-and-eval/m-p/454613#M128607</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to count the number of events for a specific index/sourcetype combo, and then total them into a new field, using eval.  I've tried this, but looks like my logic is off, as the numbers are very weird - looks like it's counting the number of splunk servers.  I want to count the number of events per splunk_server and then total them into  a new field named splunk_region.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index=cisco AND sourcetype="cisco:asa" by  splunk_server _time
| eval splunk_region = case(like(splunk_server,"%bos-%"),"BOS" , 
like(splunk_server, "dfw-%"),"DFW",
like(splunk_server, "%lax-%"), "LAX", 
like(splunk_server, "%"),"OTHER") 
| timechart span=1d count by splunk_region
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-tstats-and-eval/m-p/454613#M128607</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-30T01:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: help with tstats and eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-with-tstats-and-eval/m-p/454614#M128608</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index=cisco AND sourcetype="cisco:asa" BY splunk_server _time span=1d
| eval splunk_region = case(
   like(splunk_server,"%bos-%"),  "BOS", 
   like(splunk_server, "dfw-%"),  "DFW",
   like(splunk_server, "%lax-%"), "LAX", 
   true(),                        "OTHER") 
| timechart span=1d sum(count) AS count BY splunk_region
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 15:21:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-with-tstats-and-eval/m-p/454614#M128608</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-20T15:21:33Z</dc:date>
    </item>
  </channel>
</rss>

