<?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 How to count the number of dots in a domain name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117434#M183983</link>
    <description>&lt;P&gt;For exmaple:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.host.com"&gt;www.host.com&lt;/A&gt; = 2&lt;BR /&gt;
host.com     = 1 &lt;/P&gt;

&lt;P&gt;Is there an easy eval command to count the number of occurrences of a particular character in a event?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2014 17:40:12 GMT</pubDate>
    <dc:creator>splunkranger</dc:creator>
    <dc:date>2014-04-02T17:40:12Z</dc:date>
    <item>
      <title>How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117434#M183983</link>
      <description>&lt;P&gt;For exmaple:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.host.com"&gt;www.host.com&lt;/A&gt; = 2&lt;BR /&gt;
host.com     = 1 &lt;/P&gt;

&lt;P&gt;Is there an easy eval command to count the number of occurrences of a particular character in a event?&lt;/P&gt;

&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 17:40:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117434#M183983</guid>
      <dc:creator>splunkranger</dc:creator>
      <dc:date>2014-04-02T17:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117435#M183984</link>
      <description>&lt;P&gt;someone else had this issue, and this worked for them:&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/28276/count-of-character-in-field"&gt;http://answers.splunk.com/answers/28276/count-of-character-in-field&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 17:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117435#M183984</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-04-02T17:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117436#M183985</link>
      <description>&lt;P&gt;Perfect! thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 17:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117436#M183985</guid>
      <dc:creator>splunkranger</dc:creator>
      <dc:date>2014-04-02T17:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117437#M183986</link>
      <description>&lt;P&gt;Hello Bro,&lt;/P&gt;

&lt;P&gt;It was fun to find a solution to your question. I made the below query to check it out. Modify this to your requirement.&lt;/P&gt;

&lt;P&gt;Run the below query in your splunk search&lt;BR /&gt;&lt;BR /&gt;
index=main | head 1  | eval custom_test="This . is . Eashwar . Raghunathan . and . i . am . playing . with . 10 . dots" | rex mode=sed field=custom_test "s/[^.]/X/g s/X//g" | eval NumberOfDots=len(custom_test) | table custom_test NumberOfDots&lt;/P&gt;

&lt;P&gt;Hope in your case you will pass the string domain instead of custom_test&lt;/P&gt;

&lt;P&gt;Happy splunking bro, thanks for asking tough questions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117437#M183986</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2020-09-28T16:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117438#M183987</link>
      <description>&lt;P&gt;You could just have "s/[^.]//g"  in your sed&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 20:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117438#M183987</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2014-04-02T20:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117439#M183988</link>
      <description>&lt;P&gt;Hey i did it first, for some reason it did not work. It was  unusual, so i was trying a couple of other ways to achieve the same&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 05:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117439#M183988</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2014-04-03T05:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of dots in a domain name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117440#M183989</link>
      <description>&lt;P&gt;Hello AELLIOTT it is working now for me, I don't know why it did not work yesterday &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ... Confused&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 08:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-the-number-of-dots-in-a-domain-name/m-p/117440#M183989</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2014-04-03T08:10:33Z</dc:date>
    </item>
  </channel>
</rss>

