<?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: search urlencoded string not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133640#M36492</link>
    <description>&lt;P&gt;The answer is to do CASE("%2F%63%67%69%2D%62%69%6E%2F") ... then splunk stops doing odd things with the text and matches strings in fields quickly.  I think this is a hack though.  It is also blazingly fast to use in a search compared to using the | regex ....&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2013 21:17:24 GMT</pubDate>
    <dc:creator>stephen1h</dc:creator>
    <dc:date>2013-11-07T21:17:24Z</dc:date>
    <item>
      <title>search urlencoded string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133638#M36490</link>
      <description>&lt;P&gt;I have created a regex search that can search strings in a field, but it is slow.  Is there a way that I can search a string without having to use regex for specific urlencoded data?&lt;/P&gt;

&lt;P&gt;For instance.  I can do:&lt;/P&gt;

&lt;P&gt;*| regex "\%[0-9a-fA-F]{2}"&lt;/P&gt;

&lt;P&gt;night and day, but a combination of that regex is slow. &lt;/P&gt;

&lt;P&gt;I know specific strings of urlencoded data that I want to match on.  When I do a search on that data (for instance "%2F%63%67%69%2D%62%69%6E%2F" or  "\%2F\%63\%67\%69\%2D\%62\%69\%6E\%2F", I see in the inspector that my search has been changed. The percent signs are now spaces like the following: "[ AND 2d 2f 62 63 67 69 6e index::main ]" ... It looks like my urlencoded data is being split on the percent sign, sorted, and then searched.... How do I get it to treat it like a string and leave it alone and search for my explicit string?&lt;/P&gt;

&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 20:52:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133638#M36490</guid>
      <dc:creator>stephen1h</dc:creator>
      <dc:date>2013-11-07T20:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: search urlencoded string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133639#M36491</link>
      <description>&lt;P&gt;Look at the docs for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions"&gt;Functions for eval and where&lt;/A&gt;. Second to the last entry in the table is urldecode(). The description is:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;This function takes one URL string argument X and returns the unescaped or decoded URL string.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The example is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval n=urldecode("http%3A%2F%2Fwww.splunk.com%2Fdownload%3Fr%3Dheader")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result would be that n is "&lt;A href="http://www.splunk.com/download?r=header"&gt;http://www.splunk.com/download?r=header&lt;/A&gt;".&lt;/P&gt;

&lt;P&gt;For your use, insert&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;… | eval newfield=urldecode(yourfield) | …
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then do your regex.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 21:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133639#M36491</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-07T21:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: search urlencoded string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133640#M36492</link>
      <description>&lt;P&gt;The answer is to do CASE("%2F%63%67%69%2D%62%69%6E%2F") ... then splunk stops doing odd things with the text and matches strings in fields quickly.  I think this is a hack though.  It is also blazingly fast to use in a search compared to using the | regex ....&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 21:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133640#M36492</guid>
      <dc:creator>stephen1h</dc:creator>
      <dc:date>2013-11-07T21:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: search urlencoded string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133641#M36493</link>
      <description>&lt;P&gt;CASE() is often a speed killer on a search, so use it with caution. Unless the regex is looking at the url encoding format specifically, it's not the best plan really.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 21:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133641#M36493</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-07T21:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: search urlencoded string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133642#M36494</link>
      <description>&lt;P&gt;I'm guessing you meant TERM()?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2013 21:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-urlencoded-string-not-working/m-p/133642#M36494</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-07T21:25:19Z</dc:date>
    </item>
  </channel>
</rss>

