<?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 for IP Address and URL in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26531#M5142</link>
    <description>&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; That worked !! &lt;/P&gt;</description>
    <pubDate>Sun, 10 Feb 2013 16:24:26 GMT</pubDate>
    <dc:creator>prabmurthy</dc:creator>
    <dc:date>2013-02-10T16:24:26Z</dc:date>
    <item>
      <title>Regex for IP Address and URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26529#M5140</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've 2 fields 1. Host with data which looks something like this ip-10-222-98-898, ip-10-982-83-821, ip-10-233-04-291 etc and other field (say Color) which has some text data example: Red, Yellow, White, Green.&lt;/P&gt;

&lt;P&gt;I'd like to have something like this:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Column1 data should look like something like 10-222-98-898, 10-982-83-821 etc&lt;/LI&gt;
&lt;LI&gt;Column2 data should look like &lt;A href="http://10-982-83-821/Red"&gt;http://10-982-83-821/Red&lt;/A&gt; (in this case 10-982-83-821 has field value red and so on..&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;What I was thinking was if I could get #1 ready then I can have a new variable say URL which will look something like URL=http://$host/$Color (I'm not sure of the syntax of how to fetch the fields but my try will look something like this)&lt;/P&gt;

&lt;P&gt;How do I get started with #1 and any points for #2?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;PM &lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sun, 10 Feb 2013 10:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26529#M5140</guid>
      <dc:creator>prabmurthy</dc:creator>
      <dc:date>2013-02-10T10:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for IP Address and URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26530#M5141</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | rex field=host "(?&amp;lt;ip&amp;gt;\d+-\d+-\d+-\d+)" | eval url = "http://".ip."/".color
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to replace the dashes in the host with dots you can throw in this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval ip = replace(ip, "-", ".") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2013 12:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26530#M5141</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-10T12:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for IP Address and URL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26531#M5142</link>
      <description>&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; That worked !! &lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2013 16:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-IP-Address-and-URL/m-p/26531#M5142</guid>
      <dc:creator>prabmurthy</dc:creator>
      <dc:date>2013-02-10T16:24:26Z</dc:date>
    </item>
  </channel>
</rss>

