<?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 not working event after validating in regex101.com in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396004#M169468</link>
    <description>&lt;P&gt;This is my regex :&lt;/P&gt;

&lt;P&gt;Test Name\","value":"(?.*)},{"key"&lt;/P&gt;

&lt;P&gt;and my test string is :&lt;/P&gt;

&lt;P&gt;{"key":"Test Name","value":"GET:Corp Ping Test"},{"key":"URL","value"&lt;/P&gt;

&lt;P&gt;Basically i want to extract this set "GET:Corp Ping Test" , splunk doesnt extract anything in &lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 18:44:15 GMT</pubDate>
    <dc:creator>macadminrohit</dc:creator>
    <dc:date>2018-05-10T18:44:15Z</dc:date>
    <item>
      <title>Regex not working event after validating in regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396004#M169468</link>
      <description>&lt;P&gt;This is my regex :&lt;/P&gt;

&lt;P&gt;Test Name\","value":"(?.*)},{"key"&lt;/P&gt;

&lt;P&gt;and my test string is :&lt;/P&gt;

&lt;P&gt;{"key":"Test Name","value":"GET:Corp Ping Test"},{"key":"URL","value"&lt;/P&gt;

&lt;P&gt;Basically i want to extract this set "GET:Corp Ping Test" , splunk doesnt extract anything in &lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 18:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396004#M169468</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-10T18:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex not working event after validating in regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396005#M169469</link>
      <description>&lt;P&gt;@macadminrohit you need to escape the double quotes inside &lt;CODE&gt;rex&lt;/CODE&gt; command using backslash. Try the following if rex needs to be applied on _raw data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
| rex ",\"value\":\"(?&amp;lt;value&amp;gt;[^\"]+)\"\}\,"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere search based on code snippet and clarification provided.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"key\":\"Test Name\",\"value\":\"GET:Corp Ping Test\"},{\"key\":\"URL\",\"value\""
| rex ",\"value\":\"(?&amp;lt;value&amp;gt;[^\"]+)\"\}\,"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;

&lt;P&gt;PS: Use the code button (&lt;CODE&gt;101010&lt;/CODE&gt; or shortcut &lt;CODE&gt;Ctrl+K&lt;/CODE&gt;) on Splunk Answers for posting code, SPL, data to ensure that special characters do not escape. Alternatively you can add &lt;CODE&gt;four spaces before each line of code/SPL/data&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 18:56:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396005#M169469</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-10T18:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regex not working event after validating in regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396006#M169470</link>
      <description>&lt;P&gt;I think you are missing a name for your capture group.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Test Name\","value":"(?&amp;lt;myfield&amp;gt;.*)"},{"key"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I wasn't sure if you wanted the quote at the end so I removed it as well.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 19:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396006#M169470</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2018-05-10T19:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex not working event after validating in regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396007#M169471</link>
      <description>&lt;P&gt;Thanks Niket. It works like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 19:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396007#M169471</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-10T19:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regex not working event after validating in regex101.com</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396008#M169472</link>
      <description>&lt;P&gt;i missed that in my question, but actually was there in regex. I missed to add \ to mask the double quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 21:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-not-working-event-after-validating-in-regex101-com/m-p/396008#M169472</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-10T21:14:30Z</dc:date>
    </item>
  </channel>
</rss>

