<?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: Need help with grouping an counting. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230392#M68303</link>
    <description>&lt;P&gt;understood.  thanks&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2017 08:31:11 GMT</pubDate>
    <dc:creator>rajivchadha</dc:creator>
    <dc:date>2017-01-17T08:31:11Z</dc:date>
    <item>
      <title>Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230385#M68296</link>
      <description>&lt;P&gt;Hi I have the below event output in the a log.&lt;/P&gt;

&lt;P&gt;2016-11-03 17:59:02,943 INFO [SerialClientScheduler-1] c.b.t.m.s.MarketDataServer [?:?] Subscribe for SubscriptionDetails(subscriptions=[BloombergSubscription(identifier=//blp/mktdata/ticker/VOD LN Equity, correlationId=User: 2, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='VOD LN Equity'}), BloombergSubscription(identifier=//blp/mktdata/sedol/0912332 LN, correlationId=User: 3, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='0912332', otherExchangeCode='XLON', bloombergExchangeCode='LN'}), BloombergSubscription(identifier=//blp/mktdata/sedol/5529027 GY, correlationId=User: 4, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='5529027', otherExchangeCode='XETR', bloombergExchangeCode='GY'}), BloombergSubscription(identifier=//blp/mktdata/sedol/4699330 FP, correlationId=User: 5, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='4699330', otherExchangeCode='XPAR', bloombergExchangeCode='FP'}), BloombergSubscription(identifier=//blp/mktdata/ticker/SAN SM Equity, correlationId=User: 6, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='SAN SM'}), BloombergSubscription(identifier=//blp/mktdata/ticker/BARC L Equity, correlationId=User: 7, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='BARC L Equity'}), BloombergSubscription(identifier=//blp/mktdata/ticker/TSCO LN Equity, correlationId=User: 8, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='TSCO LN'}), BloombergSubscription(identifier=//blp/mktdata/ticker/ENI IM Equity, correlationId=User: 9, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='ENI IM Equity'})])&lt;/P&gt;

&lt;P&gt;I am trying to count the number of times "identifier=" appears in the event.  How can do this?  I have tried to work with makemv and mvexpand without success.&lt;/P&gt;

&lt;P&gt;Also this type of event can appear multiple times in the log and also across different days.  Could you provide  some guidance on how I can do the same count across multiple events and days.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230385#M68296</guid>
      <dc:creator>rajivchadha</dc:creator>
      <dc:date>2020-09-29T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230386#M68297</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;P&gt;To get number of times "identifier=" string is found, try like this (adding a field 'identifier_count' with the count in each event)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex max_match=0 "(?&amp;lt;identifier_count&amp;gt;identifier\=)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get total number of times the "identifier=" is found in all events spanning across multiple days,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search with appropriate time range | rex max_match=0 "(?&amp;lt;identifier_count&amp;gt;identifier\=)"  | stats sum(identifier_count) as total_identifier_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get total number of times the "identifier=" is found in all events on per day-wise summary,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search with appropriate time range | rex max_match=0 "(?&amp;lt;identifier_count&amp;gt;identifier\=)"  | timechart span=1d sum(identifier_count) as total_identifier_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Jan 2017 16:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230386#M68297</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-16T16:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230387#M68298</link>
      <description>&lt;P&gt;Thanks.  Will have a go and respond.  Is there a also a way to say split the below line into multiple events and then do a count.  I could split the line by doing a count on BloombergSubscription(identifier&lt;/P&gt;

&lt;P&gt;2016-11-03 17:59:02,943 INFO [SerialClientScheduler-1] c.b.t.m.s.MarketDataServer [?:?] Subscribe for SubscriptionDetails(subscriptions=[&lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/ticker/VOD LN Equity, correlationId=User: 2, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='VOD LN Equity'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/sedol/0912332 LN, correlationId=User: 3, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='0912332', otherExchangeCode='XLON', bloombergExchangeCode='LN'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/sedol/5529027 GY, correlationId=User: 4, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='5529027', otherExchangeCode='XETR', bloombergExchangeCode='GY'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/sedol/4699330 FP, correlationId=User: 5, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=SEDOL, symbol='4699330', otherExchangeCode='XPAR', bloombergExchangeCode='FP'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/ticker/SAN SM Equity, correlationId=User: 6, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='SAN SM'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/ticker/BARC L Equity, correlationId=User: 7, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='BARC L Equity'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/ticker/TSCO LN Equity, correlationId=User: 8, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='TSCO LN'}), &lt;/P&gt;

&lt;P&gt;BloombergSubscription(identifier=//blp/mktdata/ticker/ENI IM Equity, correlationId=User: 9, fields=[MD_EVENT_TYPE, MD_SUB_EVENT_TYPE, BID_PRICE, BID_QTY, ASK_PRICE, ASK_QTY, EID, LAST_PRICE, LAST_QTY], callBackId=02c08163-9ce9-4690-a92a-9d3ac0e37c11, bloombergInstrumentSymbolInfo=BloombergInstrumentSymbolInfo{instrumentSymbolType=BLOOMBERG, symbol='ENI IM Equity'})])&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:23:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230387#M68298</guid>
      <dc:creator>rajivchadha</dc:creator>
      <dc:date>2020-09-29T12:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230388#M68299</link>
      <description>&lt;P&gt;Hi rajivchadha &lt;/P&gt;

&lt;P&gt;You can use the rex command to search for the "identifier=" pattern in your raw events and assign the values after the pattern to a new field named "identifier". Then use mvexpand to convert this multi-value field into multiple individual events for each field value. &lt;BR /&gt;
Here is an example for your reference: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="&amp;lt;your_sourcetype&amp;gt;" | rex field=_raw "identifier=(?&amp;lt;identifier&amp;gt;\S*)\s" max_match=0 | table identifier | mvexpand identifier | stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps. Thanks! &lt;BR /&gt;
Hunter&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 17:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230388#M68299</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-16T17:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230389#M68300</link>
      <description>&lt;P&gt;Thanks.  I tried the below and it worked&lt;/P&gt;

&lt;P&gt;index="md_dev"  ( "Subscribe for") | rex "identifier=(?\S*)\s" max_match=0 | mvexpand identifier | stats count by identifier &lt;/P&gt;

&lt;P&gt;I managed to get a table of identifiers with a count.&lt;/P&gt;

&lt;P&gt;Another quick question any idea on why the below did not work.  I just changed the identifier and renamed it to id.&lt;/P&gt;

&lt;P&gt;index="md_dev"  ( "Subscribe for") | rex "id=(?\S*)\s" max_match=0 | mvexpand id | stats count by id &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230389#M68300</guid>
      <dc:creator>rajivchadha</dc:creator>
      <dc:date>2020-09-29T12:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230390#M68301</link>
      <description>&lt;P&gt;Hi rajivchadha, &lt;/P&gt;

&lt;P&gt;When you use the rex command, you must specify a new field name (in brackets) to which to assign the regex-captured group. &lt;BR /&gt;
For example, extract "from" and "to" fields using regular expressions. If a raw event contains "From: Susan To: Bob", then from=Susan and to=Bob. &lt;BR /&gt;
    ... | rex field=_raw "From: (?&lt;FROM&gt;.&lt;EM&gt;) To: (?&lt;TO&gt;.&lt;/TO&gt;&lt;/EM&gt;)"&lt;BR /&gt;
For more information, please refer to documentation: &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Rex&lt;/A&gt;&lt;/FROM&gt;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 18:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230390#M68301</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-16T18:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230391#M68302</link>
      <description>&lt;P&gt;The tips were very useful and help me achieve what I needed.  Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 08:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230391#M68302</guid>
      <dc:creator>rajivchadha</dc:creator>
      <dc:date>2017-01-17T08:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with grouping an counting.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230392#M68303</link>
      <description>&lt;P&gt;understood.  thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 08:31:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-grouping-an-counting/m-p/230392#M68303</guid>
      <dc:creator>rajivchadha</dc:creator>
      <dc:date>2017-01-17T08:31:11Z</dc:date>
    </item>
  </channel>
</rss>

