<?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: Regex Extracting Phonehome  client name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107864#M28062</link>
    <description>&lt;P&gt;Thanks Kristian this helps.&lt;/P&gt;

&lt;P&gt;Like I said above I was hoping to get the FQDN.&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2013 17:27:15 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2013-10-21T17:27:15Z</dc:date>
    <item>
      <title>Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107861#M28059</link>
      <description>&lt;P&gt;Here are my _internal Phonehome logs for UF client connections:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;xxx.xxx.128.89 - - [21/Oct/2013:09:49:47.820 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.128.89_8089_xxx.xxx.128.89_iuppiter.sub.com_ea HTTP/1.0" 200 1226 - - - 45ms&lt;BR /&gt;
xxx.xxx.254.211 - - [21/Oct/2013:09:49:47.470 -0500] "POST /services/broker/phonehome/connection_128.157.254.211_8089_sub-ia-dump1.sub.domain.com_sub-ia-dump01.sub.domain.com_ia HTTP/1.0" 200 1300 - - - 42ms&lt;BR /&gt;
xxx.xxx.182.29 - - [21/Oct/2013:09:49:47.451 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.182.29_8089_sub-ia-render02.sub.domain.com_sub-IA-RENDER02_ia HTTP/1.0" 200 278 - - - 41ms&lt;BR /&gt;
xxx.xxx.15.201 - - [21/Oct/2013:09:49:47.440 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.15.201_8089_agdl.sub.domain.com_blade014_ea HTTP/1.0" 200 1303 - - - 44ms&lt;BR /&gt;
xxx.xxx.182.29 - - [21/Oct/2013:09:49:47.384 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.182.29_8089_sub-ia-render02.sub.domain.com_sub-IA-RENDER02_ia HTTP/1.0" 200 2277 - - - 43ms&lt;BR /&gt;
xxx.xxx.94.221 - - [21/Oct/2013:09:49:47.189 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.94.221_8089_sub-it-bak01a.sub.domain.com_sub-it-bak01a.sub.domain.com_ia HTTP/1.0" 200 278 - - - 41ms&lt;BR /&gt;
xxx.xxx.138.96 - - [21/Oct/2013:09:49:47.161 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.138.96_8089_sub-ia-snlmdc02.sub.domain.com_sub-ia-snlmdc02.ndc.domain.com_ia HTTP/1.0" 200 1302 - - - 42ms&lt;BR /&gt;
xxx.xxx.226.17 - - [21/Oct/2013:09:49:47.158 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.226.17_8089_xxx.xxx.226.17_skynet.sub.domain.com_ea HTTP/1.0" 200 1314 - - - 43ms&lt;BR /&gt;
xxx.xxx.10.12 - - [21/Oct/2013:09:49:47.015 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.10.12_8089_subb-dacs2.dacs.subb.sub.domain.com_subb-dacs2_w-ra HTTP/1.0" 200 278 - - - 101ms&lt;BR /&gt;
xxx.xxx.10.4 - - [21/Oct/2013:09:49:46.920 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.10.4_8089_subb-pta.dacs.subb.sub.domain.com_subb-PTA_w-ra HTTP/1.0" 200 1073 - - - 102ms&lt;BR /&gt;
xxx.xxx.10.12 - - [21/Oct/2013:09:49:46.826 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.10.12_8089_subb-dacs2.dacs.subb.sub.domain.com_subb-dacs2_w-ra HTTP/1.0" 200 1075 - - - 101ms&lt;BR /&gt;
xxx.xxx.10.4 - - [21/Oct/2013:09:49:46.735 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.10.4_8089_subb-pta.dacs.subb.sub.domain.com_subb-PTA_w-ra HTTP/1.0" 200 1073 - - - 101ms&lt;BR /&gt;
xxx.xxx.94.117 - - [21/Oct/2013:09:49:46.489 -0500] "POST /services/broker/phonehome/connection_xxx.xxx.94.117_8089_sub-ia-fs01b.sub.domain.com_sub-IA-FS01B_ia HTTP/1.0" 200 1281 - - - 42ms&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I want to extract the client host name.&lt;BR /&gt;
I could use this &lt;STRONG&gt;[ &lt;CODE&gt;(?i).+phonehome.+_8089_(?P&amp;lt;FIELDNAME&amp;gt;.+?)_&lt;/CODE&gt; ]&lt;/STRONG&gt; but in some cases this produces an IP (see first event in logs above)&lt;/P&gt;

&lt;P&gt;I don't know who to get the host name when it is preceded by the client IP first.&lt;BR /&gt;
Can you help?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 15:36:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107861#M28059</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-10-21T15:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107862#M28060</link>
      <description>&lt;P&gt;I got good results with this regex string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i).+phonehome.+8089_(.+_)?(?P&amp;lt;fieldname&amp;gt;.+?)_
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A helpful site for testing regex strings is &lt;A href="http://www.regexplanet.com/advanced/perl/index.html"&gt;RegexPlanet&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 16:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107862#M28060</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-10-21T16:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107863#M28061</link>
      <description>&lt;P&gt;An excerpt of the relevant part of some of your events, edited for redability.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_8089_sub-ia-dump1.sub.domain.com          _sub-ia-dump01.sub.domain.com     _ia
_8089_sub-ia-fs01b.sub.domain.com          _sub-IA-FS01B                     _ia
_8089_subb-dacs2.dacs.subb.sub.domain.com  _subb-dacs2                       _w-ra
_8089_xxx.xxx.226.17                       _skynet.sub.domain.com            _ea
_8089_sub-ia-snlmdc02.sub.domain.com       _sub-ia-snlmdc02.ndc.domain.com   _ia
_8089_sub-ia-render02.sub.domain.com       _sub-IA-RENDER02                  _ia
_8089_xxx.xxx.128.89                       _iuppiter.sub.com                 _ea
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It seems that underscore separates the values you're after within the string. (I take it you want the second column above, right?) Then the following regex should work for you;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal phonehome | rex "_8089_[^_]+_(?&amp;lt;myfield&amp;gt;[^_]+)_" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;I believe this should work, i.e. if the first part is an IP address, it will skip over to the next part.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal phonehome | rex "_8089_(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}_)?(?&amp;lt;myfield&amp;gt;[^_]+)_" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107863#M28061</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-21T17:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107864#M28062</link>
      <description>&lt;P&gt;Thanks Kristian this helps.&lt;/P&gt;

&lt;P&gt;Like I said above I was hoping to get the FQDN.&lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:27:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107864#M28062</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-10-21T17:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107865#M28063</link>
      <description>&lt;P&gt;you want the first 'column' but only if it's a FQDN, otherwise take 'column' 2, so to speak?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107865#M28063</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-21T17:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Extracting Phonehome  client name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107866#M28064</link>
      <description>&lt;P&gt;see update above&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Extracting-Phonehome-client-name/m-p/107866#M28064</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-21T17:55:51Z</dc:date>
    </item>
  </channel>
</rss>

