<?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 to count specific data separated by pipe character ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540726#M153015</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231734"&gt;@Linnie25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the fields are not extracted, then, you have to use rex to find out the country and then count.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval log="|test|13e|1234|guest |CA|1.2|test|test" 
| rex field=log "\|(?&amp;lt;country&amp;gt;\w\w)\|\d" 
| stats count by country&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12994i342469B46A83985B/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex.png" alt="rex.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2021 17:02:05 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2021-02-21T17:02:05Z</dc:date>
    <item>
      <title>How to count specific data separated by pipe character ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540720#M153012</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have below data and would like to get count by country code. Is it possible to get it ?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;21/02/2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;12:36:29.048&lt;/SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;INFO&lt;/SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;1234&lt;/SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN class="t"&gt;guest&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;CA&lt;/SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.10.1&lt;/SPAN&gt;&lt;SPAN&gt;| &lt;/SPAN&gt;&lt;SPAN class="t a"&gt;[&lt;SPAN class="t"&gt;END&lt;/SPAN&gt;] &lt;SPAN class="t"&gt;-&lt;/SPAN&gt; &lt;SPAN class="t"&gt;DetailsLookUp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;21/02/2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;12:26:20.534&lt;/SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;INFO&lt;/SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;8669&lt;/SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN class="t"&gt;guest&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;|&lt;SPAN class="t"&gt;US&lt;/SPAN&gt;|&lt;/SPAN&gt;&lt;SPAN class="t"&gt;1.10.1&lt;/SPAN&gt;&lt;SPAN&gt;| &lt;/SPAN&gt;&lt;SPAN class="t a"&gt;[&lt;SPAN class="t"&gt;END&lt;/SPAN&gt;] &lt;SPAN class="t"&gt;-&lt;/SPAN&gt; &lt;SPAN class="t"&gt;DetailsLookUp&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 13:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540720#M153012</guid>
      <dc:creator>Linnie25</dc:creator>
      <dc:date>2021-02-21T13:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to count specific data separated by pipe character ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540721#M153013</link>
      <description>&lt;P&gt;What are the fields that have been extracted for this data?&lt;BR /&gt;&lt;BR /&gt;Is there any field extracted that has the country code value, if so then you can easily get the count by country code.&lt;BR /&gt;&lt;BR /&gt;As an example,&lt;/P&gt;&lt;P&gt;If the field containing the country code is called "code", you could get the count by country code using the below SPL query,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main | stats count by code&lt;/LI-CODE&gt;&lt;P&gt;Replace the index value with the actual index in which the data is being stored.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 13:53:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540721#M153013</guid>
      <dc:creator>AhmadKhattak20</dc:creator>
      <dc:date>2021-02-21T13:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to count specific data separated by pipe character ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540724#M153014</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231734"&gt;@Linnie25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As implied, you need to extract the country code value into a field. At search time, you can use the rex command with an appropriate regular expression:&lt;/P&gt;&lt;P&gt;| rex "\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|(?&amp;lt;country_code&amp;gt;[^|]*)"&lt;BR /&gt;| stats count by country_code&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 16:58:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540724#M153014</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-02-21T16:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count specific data separated by pipe character ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540726#M153015</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231734"&gt;@Linnie25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the fields are not extracted, then, you have to use rex to find out the country and then count.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval log="|test|13e|1234|guest |CA|1.2|test|test" 
| rex field=log "\|(?&amp;lt;country&amp;gt;\w\w)\|\d" 
| stats count by country&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rex.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12994i342469B46A83985B/image-size/large?v=v2&amp;amp;px=999" role="button" title="rex.png" alt="rex.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 17:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540726#M153015</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2021-02-21T17:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to count specific data separated by pipe character ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540773#M153046</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231072"&gt;@AhmadKhattak20&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for giving me the ideas how to work this out.&lt;/P&gt;&lt;P&gt;There is no field specify for the country code so I use Field Extractor and now I'm able to get the count&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But since I use source as Data Type I'm not able to change the Permission. From what I read it seems like there is issue when using source instead of sourcetype.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 07:00:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-specific-data-separated-by-pipe-character/m-p/540773#M153046</guid>
      <dc:creator>Linnie25</dc:creator>
      <dc:date>2021-02-22T07:00:30Z</dc:date>
    </item>
  </channel>
</rss>

