<?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 with forward slash character in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256199#M175816</link>
    <description>&lt;P&gt;I got my problem ...&lt;BR /&gt;
The logs I was trying to parse was Internet access logs.&lt;BR /&gt;
I was trying to separate the Mime Type field precalculated which was formed like this:&lt;BR /&gt;
mt=video/mp4 for example.&lt;/P&gt;

&lt;P&gt;My extraction was: rex field=mt "(?[a-zA-Z0-9]+)/\//(?[a-zA-Z0-9]+)"| &lt;/P&gt;

&lt;P&gt;And ... I discover that some logs include in the URL the "mime" value ...&lt;BR /&gt;
So the treatment I was trying to do was also based on this value ...&lt;/P&gt;

&lt;P&gt;I've corrected the name of the extracted field and it's working fine ...&lt;/P&gt;

&lt;P&gt;Thanks a lot for your help !!!!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 16:08:40 GMT</pubDate>
    <dc:creator>Keyrl</dc:creator>
    <dc:date>2017-01-27T16:08:40Z</dc:date>
    <item>
      <title>Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256193#M175810</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to extract to fields from a precalculated field and so far I've trouble with the forward slash character.&lt;BR /&gt;
My field is formed like this:&lt;/P&gt;

&lt;P&gt;FieldGlobal=Field1/Field2&lt;/P&gt;

&lt;P&gt;I've tried the following : rex field=FieldGloba "(?[a-zA-Z0-9]+)\/(?[a-zA-Z0-9]+)"&lt;/P&gt;

&lt;P&gt;So far, it works for a lot of logs but for some, it gave something like:&lt;/P&gt;

&lt;P&gt;FieldExtracted1=Field1%2fField2&lt;/P&gt;

&lt;P&gt;Do you know how to work with that ?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256193#M175810</guid>
      <dc:creator>Keyrl</dc:creator>
      <dc:date>2017-01-27T15:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256194#M175811</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=FieldGloba "(?&amp;lt;FieldExtracted1&amp;gt;[^\/]+)\/(?&amp;lt;FieldExtracted1&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:35:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256194#M175811</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-27T15:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256195#M175812</link>
      <description>&lt;P&gt;Thanks for your help !&lt;/P&gt;

&lt;P&gt;Same result apparently. I still have the "/" character that seems to be converted as %2F in some logs ...&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256195#M175812</guid>
      <dc:creator>Keyrl</dc:creator>
      <dc:date>2017-01-27T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256196#M175813</link>
      <description>&lt;P&gt;I guess the raw data itself contains the that forwarder slash converted to %2F. So how about this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=FieldGloba "(?&amp;lt;FieldExtracted1&amp;gt;.)(\/|%2F)(?&amp;lt;FieldExtracted1&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:42:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256196#M175813</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-27T15:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256197#M175814</link>
      <description>&lt;P&gt;Mmhhh already tried it and it's even worse &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I don't understand why as it should match ...&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:52:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256197#M175814</guid>
      <dc:creator>Keyrl</dc:creator>
      <dc:date>2017-01-27T15:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256198#M175815</link>
      <description>&lt;P&gt;Well at this time, I would ask for sample events  (scrub any sensitive information) for both scenarios ( where it's working and where it's not).&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256198#M175815</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-27T15:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256199#M175816</link>
      <description>&lt;P&gt;I got my problem ...&lt;BR /&gt;
The logs I was trying to parse was Internet access logs.&lt;BR /&gt;
I was trying to separate the Mime Type field precalculated which was formed like this:&lt;BR /&gt;
mt=video/mp4 for example.&lt;/P&gt;

&lt;P&gt;My extraction was: rex field=mt "(?[a-zA-Z0-9]+)/\//(?[a-zA-Z0-9]+)"| &lt;/P&gt;

&lt;P&gt;And ... I discover that some logs include in the URL the "mime" value ...&lt;BR /&gt;
So the treatment I was trying to do was also based on this value ...&lt;/P&gt;

&lt;P&gt;I've corrected the name of the extracted field and it's working fine ...&lt;/P&gt;

&lt;P&gt;Thanks a lot for your help !!!!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 16:08:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256199#M175816</guid>
      <dc:creator>Keyrl</dc:creator>
      <dc:date>2017-01-27T16:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regex with forward slash character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256200#M175817</link>
      <description>&lt;P&gt;Glad things are working for you now.  You can accept your own answer to make this question as resolved.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 16:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-with-forward-slash-character/m-p/256200#M175817</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-27T16:38:33Z</dc:date>
    </item>
  </channel>
</rss>

