<?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: Rex pattern to extract unc path from xml in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476973#M85850</link>
    <description>&lt;P&gt;Maybe this will help...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mystring = "&amp;lt;soa:FileSystem identifier=\"8ec65285-11ac-45a5-9652-425b7494b0df\" name=\"Windows\" description=\"Windows File System\" leftaligncheckboxes=\"false\" instance=\"102711ce-e483-46bc-bf6c-f42ae6faf234\" signature=\"00000000-0000-0000-0000-000000000000\" scheme=\"file\" opencapable=\"true\" consumeopen=\"true\" emitopen=\"true\"&amp;gt;&amp;lt;soa:Location&amp;gt;file://fileserver/folder/folder1/folder2/&amp;lt;/soa:Location&amp;gt;"
| rex field=mystring "&amp;lt;soa:Location&amp;gt;file:(?P&amp;lt;filelocation&amp;gt;[^&amp;lt;]*)&amp;lt;\/soa:Location&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 17 Apr 2020 01:00:56 GMT</pubDate>
    <dc:creator>memarshall63</dc:creator>
    <dc:date>2020-04-17T01:00:56Z</dc:date>
    <item>
      <title>Rex pattern to extract unc path from xml</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476972#M85849</link>
      <description>&lt;P&gt;I like to extract the UNC path from a log, below a portion from the file :&lt;/P&gt;
&lt;P&gt;;&amp;lt;soa:FileSystem identifier="8ec65285-11ac-45a5-9652-425b7494b0df" name="Windows" description="Windows File System" leftaligncheckboxes="false" instance="102711ce-e483-46bc-bf6c-f42ae6faf234" signature="00000000-0000-0000-0000-000000000000" scheme="file" opencapable="true" consumeopen="true" emitopen="true"&amp;gt;&amp;lt;soa:Location&amp;gt;file:&lt;STRONG&gt;//fileserver/folder/folder1/folder2/&lt;/STRONG&gt;&amp;lt;/soa:Location&lt;/P&gt;
&lt;P&gt;I like to have this part: //fileserver/folder/folder1/folder2&lt;/P&gt;
&lt;P&gt;I have tried different rex combination without luck, any suggestions.&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 04:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476972#M85849</guid>
      <dc:creator>splunk2019tlmd</dc:creator>
      <dc:date>2020-06-08T04:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rex pattern to extract unc path from xml</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476973#M85850</link>
      <description>&lt;P&gt;Maybe this will help...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval mystring = "&amp;lt;soa:FileSystem identifier=\"8ec65285-11ac-45a5-9652-425b7494b0df\" name=\"Windows\" description=\"Windows File System\" leftaligncheckboxes=\"false\" instance=\"102711ce-e483-46bc-bf6c-f42ae6faf234\" signature=\"00000000-0000-0000-0000-000000000000\" scheme=\"file\" opencapable=\"true\" consumeopen=\"true\" emitopen=\"true\"&amp;gt;&amp;lt;soa:Location&amp;gt;file://fileserver/folder/folder1/folder2/&amp;lt;/soa:Location&amp;gt;"
| rex field=mystring "&amp;lt;soa:Location&amp;gt;file:(?P&amp;lt;filelocation&amp;gt;[^&amp;lt;]*)&amp;lt;\/soa:Location&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2020 01:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476973#M85850</guid>
      <dc:creator>memarshall63</dc:creator>
      <dc:date>2020-04-17T01:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rex pattern to extract unc path from xml</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476974#M85851</link>
      <description>&lt;P&gt;Thank you for answering,&lt;BR /&gt;
If I add the exact portion it works, but this is part of a bigger log file that I extract other fields, how could I modified the |eval function for the whole search ?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 01:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476974#M85851</guid>
      <dc:creator>splunk2019tlmd</dc:creator>
      <dc:date>2020-04-17T01:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rex pattern to extract unc path from xml</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476975#M85852</link>
      <description>&lt;P&gt;Sorry.. I don't know what you mean.  You could just look for the file: string.  So something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=mystring "file:(?P&amp;lt;filelocation&amp;gt;[^&amp;lt;]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this just looks for "file:" and then grabs whatever comes after it.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 02:12:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rex-pattern-to-extract-unc-path-from-xml/m-p/476975#M85852</guid>
      <dc:creator>memarshall63</dc:creator>
      <dc:date>2020-04-17T02:12:45Z</dc:date>
    </item>
  </channel>
</rss>

