<?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: position of a character in a string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73137#M181043</link>
    <description>&lt;P&gt;old question, but i worked through a similar problem in &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/563540/how-do-i-look-for-domains-that-arent-in-the-alexa.html#answer-579447"&gt;This question&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically, you can use these to get at different subdomain levels&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex field=dest_hostname "(?P&amp;lt;ld2&amp;gt;[\w_-]+\.[\w_-]+)$" 
  | rex field=dest_hostname "(?P&amp;lt;ld3&amp;gt;[\w_-]+\.[\w_-]+\.[\w_-]+)$" 
  | rex field=dest_hostname "(?P&amp;lt;ld4&amp;gt;[\w_-]+\.[\w_-]+\.[\w_-]+\.[\w_-]+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Nov 2017 12:55:57 GMT</pubDate>
    <dc:creator>MonkeyK</dc:creator>
    <dc:date>2017-11-21T12:55:57Z</dc:date>
    <item>
      <title>position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73132#M181038</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
I'm trying to do a substr to strings such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;google-public-dns-b.google.com
cachewas.tdp.net.pe
b.resolvers.Level3.net
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And give me back the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;google.com
tdp.net.pe
Level3.net
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought doing a &lt;STRONG&gt;&lt;EM&gt;substr(domain,(mvjoin(domain,"."))&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;
But it turned out, that way it could be achieved?&lt;BR /&gt;
I would appreciate your support.&lt;BR /&gt;
Regards&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2013 17:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73132#M181038</guid>
      <dc:creator>jrodriguezap</dc:creator>
      <dc:date>2013-09-25T17:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73133#M181039</link>
      <description>&lt;P&gt;How would you (and thus Splunk) know that the second domain is supposed to be transformed to "tdp.net.pe" and not just "net.pe"?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2013 18:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73133#M181039</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-09-25T18:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73134#M181040</link>
      <description>&lt;P&gt;I'm assuming that you have a field for that FQDN called 'hostname'. If that is not the field name, use what is the field name. If you don't have a field for the FQDN pre-defined, then the answer would be different. This answer assumes you want two levels of the domain name (as in google.com):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=hostname "\.(?&amp;lt;s_domainname&amp;gt;\S+\.\S+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Sep 2013 22:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73134#M181040</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2013-09-25T22:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73135#M181041</link>
      <description>&lt;P&gt;It's very good.&lt;BR /&gt;
Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2013 18:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73135#M181041</guid>
      <dc:creator>jrodriguezap</dc:creator>
      <dc:date>2013-09-26T18:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73136#M181042</link>
      <description>&lt;P&gt;.co.uk &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I've thought about working on an app to build up the known TLDs in order to get a correct "domain" mapping, but I never got around to it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2013 18:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73136#M181042</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-09-26T18:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: position of a character in a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73137#M181043</link>
      <description>&lt;P&gt;old question, but i worked through a similar problem in &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/563540/how-do-i-look-for-domains-that-arent-in-the-alexa.html#answer-579447"&gt;This question&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically, you can use these to get at different subdomain levels&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex field=dest_hostname "(?P&amp;lt;ld2&amp;gt;[\w_-]+\.[\w_-]+)$" 
  | rex field=dest_hostname "(?P&amp;lt;ld3&amp;gt;[\w_-]+\.[\w_-]+\.[\w_-]+)$" 
  | rex field=dest_hostname "(?P&amp;lt;ld4&amp;gt;[\w_-]+\.[\w_-]+\.[\w_-]+\.[\w_-]+)$" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 12:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/position-of-a-character-in-a-string/m-p/73137#M181043</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2017-11-21T12:55:57Z</dc:date>
    </item>
  </channel>
</rss>

