<?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 help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82004#M20803</link>
    <description>&lt;P&gt;Thank you both for your help (so far).&lt;BR /&gt;
I was hoping to use the hostname and user in a table, would that be possible considering that these variables are not permanent?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jun 2012 09:54:24 GMT</pubDate>
    <dc:creator>mariof</dc:creator>
    <dc:date>2012-06-25T09:54:24Z</dc:date>
    <item>
      <title>regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82001#M20800</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I'm new to Splunk so hope:&lt;BR /&gt;
1) I'm not asking a stupid question&lt;BR /&gt;
2) someone can help&lt;/P&gt;

&lt;P&gt;Anyway, I want to extract a hostname and user name from a "source" at search time.&lt;BR /&gt;
I know I need to "| rex field=source" but can't figure out the syntax as yet.&lt;/P&gt;

&lt;P&gt;the source I have is in the following format:&lt;BR /&gt;
/export/Data/History/servername_user&lt;/P&gt;

&lt;P&gt;Kind Regards&lt;/P&gt;

&lt;P&gt;Mario&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2012 15:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82001#M20800</guid>
      <dc:creator>mariof</dc:creator>
      <dc:date>2012-06-22T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82002#M20801</link>
      <description>&lt;P&gt;&lt;CODE&gt;rex field=source "(?i)\/export\/data\/history\/(?P&amp;lt;hostName&amp;gt;\w+)\_user"&lt;/CODE&gt;&lt;BR /&gt;
I believe should do it..&lt;/P&gt;

&lt;P&gt;You can also use the IFX (Interactive Field Extractor) to help with you extractions/regex.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Note, that rex will not make a permanent field, only one that exists in the context of the present search string.&lt;/P&gt;

&lt;P&gt;This reference is pretty good for regex&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.regular-expressions.info/reference.html"&gt;http://www.regular-expressions.info/reference.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2012 16:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82002#M20801</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-06-22T16:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82003#M20802</link>
      <description>&lt;P&gt;I'd probably use:&lt;BR /&gt;
rex field=source "(?i)\/export\/data\/history\/(?P&lt;HOSTNAME&gt;[^_]+)_(?&lt;USER&gt;\w+)"&lt;/USER&gt;&lt;/HOSTNAME&gt;&lt;/P&gt;

&lt;P&gt;Splitting out both host and user&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2012 16:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82003#M20802</guid>
      <dc:creator>mikelanghorst</dc:creator>
      <dc:date>2012-06-22T16:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82004#M20803</link>
      <description>&lt;P&gt;Thank you both for your help (so far).&lt;BR /&gt;
I was hoping to use the hostname and user in a table, would that be possible considering that these variables are not permanent?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2012 09:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/82004#M20803</guid>
      <dc:creator>mariof</dc:creator>
      <dc:date>2012-06-25T09:54:24Z</dc:date>
    </item>
  </channel>
</rss>

