<?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: How do you count the number of events in a transaction? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387553#M95922</link>
    <description>&lt;P&gt;Hi @wissenaire17,&lt;/P&gt;

&lt;P&gt;Did either of the answers below solve your problem? If so, please resolve this post by approving the one that helped you! If your problem is still not solved, keep us updated so that someone else can help. Thanks for posting!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Nov 2018 20:51:27 GMT</pubDate>
    <dc:creator>mstjohn_splunk</dc:creator>
    <dc:date>2018-11-20T20:51:27Z</dc:date>
    <item>
      <title>How do you count the number of events in a transaction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387550#M95919</link>
      <description>&lt;P&gt;I need to count the number of particular events in a transaction. Here, I NEED to count the number of tickets that have failed: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[2018-11-16 16:59:45 0665 - Scanned barcode: EndOfTicketBarcode, 2705600009993 (Referrer=2705600009993, POSNumber=056, Checksum=3) 
2018-11-16 16:59:54 0003 - Send ticket failed 
2018-11-16 17:00:06 1833 - Send ticket failed 
2018-11-16 17:00:52 8165 - BLClient :: Connected to 84.10.32.2:8091],
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Nov 2018 08:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387550#M95919</guid>
      <dc:creator>wissenaire17</dc:creator>
      <dc:date>2018-11-17T08:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of events in a transaction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387551#M95920</link>
      <description>&lt;P&gt;There's multiple ways to interpret your request here.... the first being you're looking for the number of times you have an event of "Send ticket failed" which of course is rather simple&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=whatever sourcetype=yep "Send ticket failed" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However you mention transaction... which could mean that you're using the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/transaction"&gt;transaction&lt;/A&gt; command, which as the document says for each transaction that is assembled it leaves a field of &lt;CODE&gt;eventcount&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 15:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387551#M95920</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2018-11-18T15:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of events in a transaction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387552#M95921</link>
      <description>&lt;P&gt;As mentioned, there are multiple ways to interpret your question, this it my interpretation:&lt;BR /&gt;
The original question is an example of the log and you want to see how many "Send ticket failed" it contains.&lt;BR /&gt;
In the example below I use |rex command to extract the timestamp for each "Send ticket failed" (max_match unlimited). Then you can simply count the values in Fails:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;insert base search&amp;gt;
| rex field=_raw "(?P&amp;lt;Fails&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s\d{4})\s-\sSend ticket failed" max_match=0
| eval NrOfFails=mvcount(Fails)
| table _time Referrer Fails NrOfFails
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps if the answer from @acharlieh didn't work for you!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387552#M95921</guid>
      <dc:creator>MathiasLindblom</dc:creator>
      <dc:date>2018-11-19T14:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do you count the number of events in a transaction?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387553#M95922</link>
      <description>&lt;P&gt;Hi @wissenaire17,&lt;/P&gt;

&lt;P&gt;Did either of the answers below solve your problem? If so, please resolve this post by approving the one that helped you! If your problem is still not solved, keep us updated so that someone else can help. Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 20:51:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-count-the-number-of-events-in-a-transaction/m-p/387553#M95922</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-11-20T20:51:27Z</dc:date>
    </item>
  </channel>
</rss>

