<?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 regex path without filename from source in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135169#M36947</link>
    <description>&lt;P&gt;Hallo,&lt;BR /&gt;
I fruitless tried to extract the path from the source field. My latest test is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:\\Users\\...\\...\\Logs\\*"   | rex field=source "(?&amp;lt;path&amp;gt;.*)\\.*$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Feb 2014 15:27:25 GMT</pubDate>
    <dc:creator>Moritz</dc:creator>
    <dc:date>2014-02-03T15:27:25Z</dc:date>
    <item>
      <title>regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135169#M36947</link>
      <description>&lt;P&gt;Hallo,&lt;BR /&gt;
I fruitless tried to extract the path from the source field. My latest test is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:\\Users\\...\\...\\Logs\\*"   | rex field=source "(?&amp;lt;path&amp;gt;.*)\\.*$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2014 15:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135169#M36947</guid>
      <dc:creator>Moritz</dc:creator>
      <dc:date>2014-02-03T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135170#M36948</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "(?&amp;lt;path&amp;gt;.*)[//\\\]+.[a-zA-Z.]*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2014 16:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135170#M36948</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-03T16:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135171#M36949</link>
      <description>&lt;P&gt;Thank you.&lt;BR /&gt;
A little bit better version is:&lt;BR /&gt;
    rex field=source "(?&lt;PATH&gt;.&lt;EM&gt;)[//\\\]+.[a-zA-Z.0-9]&lt;/EM&gt;"&lt;/PATH&gt;&lt;/P&gt;

&lt;P&gt;How is it possible to find all characters except \ in the latter part?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2014 08:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135171#M36949</guid>
      <dc:creator>Moritz</dc:creator>
      <dc:date>2014-02-04T08:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135172#M36950</link>
      <description>&lt;P&gt;Could you be little more specific? probably an example?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2014 14:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135172#M36950</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-04T14:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135173#M36951</link>
      <description>&lt;P&gt;my backslashes were deleted..&lt;/P&gt;

&lt;P&gt;i'd like to accept in the filename all characters except the backslash. so i thougt for something like &lt;CODE&gt;[\\][^\\]*&lt;/CODE&gt; for the last part.  (i dont really understand &lt;CODE&gt;[//\\\]&lt;/CODE&gt;.)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2014 15:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135173#M36951</guid>
      <dc:creator>Moritz</dc:creator>
      <dc:date>2014-02-04T15:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135174#M36952</link>
      <description>&lt;P&gt;I am still not clear with the requirement. Would it be possible for your provide example. like  for "C:\test\test9\some9sample.log", result should be "C:\test\test9"&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2014 15:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135174#M36952</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-02-04T15:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135175#M36953</link>
      <description>&lt;P&gt;This will also work.&lt;BR /&gt;
| rex field=source "(?&lt;PATH&gt;.*)[//\\\]"&lt;/PATH&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2014 16:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135175#M36953</guid>
      <dc:creator>rahulroy_splunk</dc:creator>
      <dc:date>2014-02-04T16:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: regex path without filename from source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135176#M36954</link>
      <description>&lt;P&gt;@rahulroy_splunk: this is what i was searching for. thank you! thank you somesoni2 for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2014 09:54:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-path-without-filename-from-source/m-p/135176#M36954</guid>
      <dc:creator>Moritz</dc:creator>
      <dc:date>2014-02-05T09:54:56Z</dc:date>
    </item>
  </channel>
</rss>

