<?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 How to show stats count grouped by two fields in a graph? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286007#M86549</link>
    <description>&lt;P&gt;I have 3 Ticket groups A, B, and C. And multiple users. My system logs every ticket purchased under each ticket group by each user as below. Every ticket purchase will have the below entry and exit log and user name in between.&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpA ticketnbr =  1232424&lt;BR /&gt;
SalesUser = user1&lt;BR /&gt;
Exit Ticket system TicketgrpA ticketnbr = 1232424&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpB ticketnbr = 1234353&lt;BR /&gt;
SalesUser = user1&lt;BR /&gt;
ExitTicket system TicketgrpB ticketnbr = 1234353&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpC ticketnbr = 1232434&lt;BR /&gt;
SalesUser = user4&lt;BR /&gt;
Exit Ticket system TicketgrpC ticketnbr = 1232434&lt;/P&gt;

&lt;P&gt;I would like to show in a graph - Number of tickets purchased by each user under each group. &lt;BR /&gt;
Y axis - Count&lt;BR /&gt;
X axis - Users grouped by ticketGrp&lt;/P&gt;

&lt;P&gt;TKTSYS* will fetch all the event logs - entry, exit and Sales User. I used below query and it is showing under statistics as below but not showing ticketgrp in the graph. counts are showing combined for all ticketgroups for each user. I want to display them so that each ticket group count is shown grouped for each user.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SalesUser ticketgrp Count
user1         A       1
user2         B       2

index=jra_app_events sourcetype=eventing appVersion=TKTSYS  TKTSYS* | transaction startswith="Entry Ticket system " endswith="Exit Ticket system" | eval ticketgrp=case(like(_raw, "%TicketgrpA%"), "A", like(_raw, "%TicketgrpB%"), "B", like(_raw, "%TicketgrpC%"), "C") | stats count by SalesUser, ticketgrp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would highly appreciated. Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2016 16:29:15 GMT</pubDate>
    <dc:creator>cseuser</dc:creator>
    <dc:date>2016-04-07T16:29:15Z</dc:date>
    <item>
      <title>How to show stats count grouped by two fields in a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286007#M86549</link>
      <description>&lt;P&gt;I have 3 Ticket groups A, B, and C. And multiple users. My system logs every ticket purchased under each ticket group by each user as below. Every ticket purchase will have the below entry and exit log and user name in between.&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpA ticketnbr =  1232424&lt;BR /&gt;
SalesUser = user1&lt;BR /&gt;
Exit Ticket system TicketgrpA ticketnbr = 1232424&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpB ticketnbr = 1234353&lt;BR /&gt;
SalesUser = user1&lt;BR /&gt;
ExitTicket system TicketgrpB ticketnbr = 1234353&lt;/P&gt;

&lt;P&gt;Entry Ticket system TicketgrpC ticketnbr = 1232434&lt;BR /&gt;
SalesUser = user4&lt;BR /&gt;
Exit Ticket system TicketgrpC ticketnbr = 1232434&lt;/P&gt;

&lt;P&gt;I would like to show in a graph - Number of tickets purchased by each user under each group. &lt;BR /&gt;
Y axis - Count&lt;BR /&gt;
X axis - Users grouped by ticketGrp&lt;/P&gt;

&lt;P&gt;TKTSYS* will fetch all the event logs - entry, exit and Sales User. I used below query and it is showing under statistics as below but not showing ticketgrp in the graph. counts are showing combined for all ticketgroups for each user. I want to display them so that each ticket group count is shown grouped for each user.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SalesUser ticketgrp Count
user1         A       1
user2         B       2

index=jra_app_events sourcetype=eventing appVersion=TKTSYS  TKTSYS* | transaction startswith="Entry Ticket system " endswith="Exit Ticket system" | eval ticketgrp=case(like(_raw, "%TicketgrpA%"), "A", like(_raw, "%TicketgrpB%"), "B", like(_raw, "%TicketgrpC%"), "C") | stats count by SalesUser, ticketgrp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would highly appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 16:29:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286007#M86549</guid>
      <dc:creator>cseuser</dc:creator>
      <dc:date>2016-04-07T16:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to show stats count grouped by two fields in a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286008#M86550</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=jra_app_events sourcetype=eventing appVersion=TKTSYS  TKTSYS* 
| transaction startswith="Entry Ticket system " endswith="Exit Ticket system" 
| eval ticketgrp=case(like(_raw, "%TicketgrpA%"), "A", like(_raw, "%TicketgrpB%"), "B", like(_raw, "%TicketgrpC%"), "C",1==1,"No Match") 
| chart count by SalesUser, ticketgrp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just use chart instead of stats&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 16:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286008#M86550</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-04-07T16:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to show stats count grouped by two fields in a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286009#M86551</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | chart count over Users by ticketGrp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Apr 2016 16:41:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286009#M86551</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-04-07T16:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to show stats count grouped by two fields in a graph?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286010#M86552</link>
      <description>&lt;P&gt;This gave the exact graph I was looking for. Thanks very much.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 16:54:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-stats-count-grouped-by-two-fields-in-a-graph/m-p/286010#M86552</guid>
      <dc:creator>cseuser</dc:creator>
      <dc:date>2016-04-07T16:54:21Z</dc:date>
    </item>
  </channel>
</rss>

