<?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: multiple counts in one table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74146#M18638</link>
    <description>&lt;P&gt;Try this:&lt;BR /&gt;
index="access" SFO earliest=-20m latest=now  | stats count by READER_NAME&lt;/P&gt;

&lt;P&gt;Keep in mind that by having SFO in your search you might only get events that contain SFO. &lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2013 00:12:10 GMT</pubDate>
    <dc:creator>adrianathome</dc:creator>
    <dc:date>2013-06-25T00:12:10Z</dc:date>
    <item>
      <title>multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74145#M18637</link>
      <description>&lt;P&gt;I have a table called READER_NAME&lt;BR /&gt;
this table has all info of reader&lt;/P&gt;

&lt;P&gt;I want to query with location(PHX,SFO,SLC,THF.TKO) and get result like this&lt;/P&gt;

&lt;P&gt;PHX:20&lt;BR /&gt;
SFO:10&lt;BR /&gt;
SLC:20&lt;BR /&gt;
THF:100&lt;BR /&gt;
TKO:10&lt;/P&gt;

&lt;P&gt;if  I do this query&lt;/P&gt;

&lt;P&gt;index="access" SFO earliest=-20m latest=now  | stats count(READER_NAME)&lt;/P&gt;

&lt;P&gt;I only get result on SFO(SFO:10)&lt;/P&gt;

&lt;P&gt;Any solution that I can get multiple counts with one query&lt;/P&gt;

&lt;P&gt;Thank you in advance &lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2013 23:53:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74145#M18637</guid>
      <dc:creator>sati80</dc:creator>
      <dc:date>2013-06-24T23:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74146#M18638</link>
      <description>&lt;P&gt;Try this:&lt;BR /&gt;
index="access" SFO earliest=-20m latest=now  | stats count by READER_NAME&lt;/P&gt;

&lt;P&gt;Keep in mind that by having SFO in your search you might only get events that contain SFO. &lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 00:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74146#M18638</guid>
      <dc:creator>adrianathome</dc:creator>
      <dc:date>2013-06-25T00:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74147#M18639</link>
      <description>&lt;P&gt;if I query&lt;BR /&gt;
index="access" earliest=-20m latest=now  | table READER_NAME&lt;/P&gt;

&lt;P&gt;It returns &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;PHX DC  STRWL
SEOL VENDOR OFF 1
KUL.26 OFFICE NTH
SEOL.37 S ELEV LOBBY ENT
TPZ DC 1.1 LOBBY MANTRAP EXIT 1
PHX DC 2.2 S OFFICE ENT
TPZ DC 1.1 LOBBY MANTRAP EXIT 1
SEOL.19 NORTH LOBBY ENT
SEOL.36 N ELEV LOBBY ENT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I want to get count on each location&lt;/P&gt;

&lt;P&gt;if I try this query&lt;/P&gt;

&lt;P&gt;index="access" earliest=-20m latest=now  | stats count(READER_NAME)&lt;/P&gt;

&lt;P&gt;it only returns count number&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 00:16:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74147#M18639</guid>
      <dc:creator>sati80</dc:creator>
      <dc:date>2013-06-25T00:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74148#M18640</link>
      <description>&lt;P&gt;I updated my answer. Check below.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 00:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74148#M18640</guid>
      <dc:creator>adrianathome</dc:creator>
      <dc:date>2013-06-25T00:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74149#M18641</link>
      <description>&lt;P&gt;I want to get all locations with one query &lt;BR /&gt;
the result should be like this&lt;BR /&gt;
PHX:20&lt;BR /&gt;
SFO:10&lt;BR /&gt;
SLC:20&lt;BR /&gt;
THF:100&lt;BR /&gt;
TKO:10&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 00:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74149#M18641</guid>
      <dc:creator>sati80</dc:creator>
      <dc:date>2013-06-25T00:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: multiple counts in one table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74150#M18642</link>
      <description>&lt;P&gt;Try it without the SFO in your search. Then write some regex to extract the Codes (SFO, PHX, SLC). Without knowing your data, see below.&lt;/P&gt;

&lt;P&gt;index="access" earliest=-20m latest=now | rex field=READER_NAME (?&lt;LOCATION&gt;^\w*) | stats count by location&lt;/LOCATION&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 01:00:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/multiple-counts-in-one-table/m-p/74150#M18642</guid>
      <dc:creator>adrianathome</dc:creator>
      <dc:date>2013-06-25T01:00:09Z</dc:date>
    </item>
  </channel>
</rss>

