<?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 comma delimited field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/545926#M154726</link>
    <description>&lt;P&gt;I am trying to get counts based on comma delimited values for specified groupings of events.&lt;/P&gt;&lt;P&gt;For instance I have the following logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Event=A Ids="55,32,5"
Event=A Ids="55"
Event=B Ids="56,63"
Event=C Ids="23,53,12"
Event=C Ids="39,6"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the data to show up in a table like the following&lt;/P&gt;&lt;TABLE border="1" width="44.36026936026936%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Event A&amp;amp;B&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Event C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;6&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I craft the query to get it to aggregate it like this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: This would be happening for a large number of events.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 20:35:13 GMT</pubDate>
    <dc:creator>neileosis</dc:creator>
    <dc:date>2021-03-29T20:35:13Z</dc:date>
    <item>
      <title>Count comma delimited field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/545926#M154726</link>
      <description>&lt;P&gt;I am trying to get counts based on comma delimited values for specified groupings of events.&lt;/P&gt;&lt;P&gt;For instance I have the following logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Event=A Ids="55,32,5"
Event=A Ids="55"
Event=B Ids="56,63"
Event=C Ids="23,53,12"
Event=C Ids="39,6"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the data to show up in a table like the following&lt;/P&gt;&lt;TABLE border="1" width="44.36026936026936%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Event A&amp;amp;B&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Event C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;6&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I craft the query to get it to aggregate it like this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: This would be happening for a large number of events.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 20:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/545926#M154726</guid>
      <dc:creator>neileosis</dc:creator>
      <dc:date>2021-03-29T20:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count comma delimited field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/545947#M154734</link>
      <description>&lt;P class="lia-align-left"&gt;This example gives you what you want - however, I have used simple logic to know that A and B need to be combined - you will have to address that grouping as you need.&lt;/P&gt;&lt;P class="lia-align-left"&gt;This example can be pasted to the splunk search. All up to the table Ids is setting up your example data&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval events="Event=A Ids=\"55,32,5\"##Event=A Ids=\"55\"##Event=B Ids=\"56,63\"##Event=C Ids=\"23,53,12\"##Event=C Ids=\"39,6\""
| makemv delim="##" events
| mvexpand events
| rename events as _raw
| extract
| table Event Ids
| eval Ids=split(Ids,",")
| eval EventGroup=if(Event="C", Event, "A&amp;amp;B")
| stats count(Ids) as idc by EventGroup
| transpose header_field=EventGroup
| fields - column&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 03:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/545947#M154734</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-03-30T03:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count comma delimited field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/546304#M154857</link>
      <description>&lt;P&gt;Thanks so much! This works as needed.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 20:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-comma-delimited-field/m-p/546304#M154857</guid>
      <dc:creator>neileosis</dc:creator>
      <dc:date>2021-03-31T20:43:06Z</dc:date>
    </item>
  </channel>
</rss>

