<?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 Count of multiple unique events per field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-of-multiple-unique-events-per-field/m-p/693289#M235894</link>
    <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two types of events that look like this&lt;/P&gt;&lt;P&gt;Type1:&lt;/P&gt;&lt;P&gt;TXN_ID=abcd inbound call INGRESS&lt;/P&gt;&lt;P&gt;Type2:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TXN_ID=abcd inbound call EGRESS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i want to find out how many events of each type per TXN_ID. If the counts per type don't match per TXN_ID, I want to out put that TXN_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know that we can do stats count by TXN_ID. But how do so do that Per event type in same query?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate the help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jul 2024 12:20:58 GMT</pubDate>
    <dc:creator>larunrahul</dc:creator>
    <dc:date>2024-07-14T12:20:58Z</dc:date>
    <item>
      <title>Count of multiple unique events per field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-multiple-unique-events-per-field/m-p/693289#M235894</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two types of events that look like this&lt;/P&gt;&lt;P&gt;Type1:&lt;/P&gt;&lt;P&gt;TXN_ID=abcd inbound call INGRESS&lt;/P&gt;&lt;P&gt;Type2:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TXN_ID=abcd inbound call EGRESS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i want to find out how many events of each type per TXN_ID. If the counts per type don't match per TXN_ID, I want to out put that TXN_ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know that we can do stats count by TXN_ID. But how do so do that Per event type in same query?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Appreciate the help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 12:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-multiple-unique-events-per-field/m-p/693289#M235894</guid>
      <dc:creator>larunrahul</dc:creator>
      <dc:date>2024-07-14T12:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count of multiple unique events per field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-of-multiple-unique-events-per-field/m-p/693291#M235895</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/269944"&gt;@larunrahul&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use the rex, chart, and where commands to extract the call type, summarize the events, and filter the results, respectively:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| makeresults format=csv data="_raw
TXN_ID=abcd inbound call INGRESS
TXN_ID=abcd inbound call EGRESS
TXN_ID=efgh inbound call INGRESS" 
| extract 
| rex "inbound call (?&amp;lt;call_type&amp;gt;[^\\s]+)" 
| chart count over TXN_ID by call_type 
| where INGRESS!=EGRESS&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;TXN_ID	EGRESS	INGRESS
efgh         0        1&lt;/LI-CODE&gt;&lt;P&gt;I've used the extract command to automatically extract the TXN_ID field in the example, but if your events are already indexed, Splunk will have done that for you automatically.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 14:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-of-multiple-unique-events-per-field/m-p/693291#M235895</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-07-14T14:39:00Z</dc:date>
    </item>
  </channel>
</rss>

