<?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: extract username for element in path in Security</title>
    <link>https://community.splunk.com/t5/Security/extract-username-for-element-in-path/m-p/36302#M1210</link>
    <description>&lt;P&gt;To do that inline in the search, you can use &lt;CODE&gt;rex&lt;/CODE&gt; in the example below, look at the fourth element of the path (i.e. source);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=source "/([^/]+/){3}(?&amp;lt;username&amp;gt;[^/]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2013 14:35:30 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-05-16T14:35:30Z</dc:date>
    <item>
      <title>extract username for element in path</title>
      <link>https://community.splunk.com/t5/Security/extract-username-for-element-in-path/m-p/36301#M1209</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Im new to regexes, and I'm trying to get the username field configuration to my extract-fields&lt;/P&gt;

&lt;P&gt;source:&lt;BR /&gt;
/u01/somedir/somedir/user1/anotherfile&lt;BR /&gt;
/u01/somedir/somedir/user3/anotherfile2&lt;BR /&gt;
/u01/somedir/somedir/user4/anotherfile3&lt;/P&gt;

&lt;P&gt;I want to get the "user1|2|3" part to a username field.&lt;/P&gt;

&lt;P&gt;Any tips?&lt;BR /&gt;
brgds/K&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 14:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/extract-username-for-element-in-path/m-p/36301#M1209</guid>
      <dc:creator>kritho</dc:creator>
      <dc:date>2013-05-16T14:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: extract username for element in path</title>
      <link>https://community.splunk.com/t5/Security/extract-username-for-element-in-path/m-p/36302#M1210</link>
      <description>&lt;P&gt;To do that inline in the search, you can use &lt;CODE&gt;rex&lt;/CODE&gt; in the example below, look at the fourth element of the path (i.e. source);&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=source "/([^/]+/){3}(?&amp;lt;username&amp;gt;[^/]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 14:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/extract-username-for-element-in-path/m-p/36302#M1210</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-16T14:35:30Z</dc:date>
    </item>
  </channel>
</rss>

