<?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: How to extract json values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526608#M148637</link>
    <description>&lt;P&gt;Throws an error...&lt;/P&gt;&lt;P&gt;Regex: missing terminating for character class.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 09:17:31 GMT</pubDate>
    <dc:creator>tsm0099</dc:creator>
    <dc:date>2020-10-27T09:17:31Z</dc:date>
    <item>
      <title>How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526598#M148632</link>
      <description>&lt;P&gt;I have an event in json which has key pairs like:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;"timestamp": 157281937,&lt;/P&gt;&lt;P&gt;"message":"abc\xyz\pqr\efg",&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a table of message with with four columns and the columns in the table will have the values abc,xyz,qpr,efg...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 08:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526598#M148632</guid>
      <dc:creator>tsm0099</dc:creator>
      <dc:date>2020-10-27T08:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526599#M148633</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath message
| rex field=message "(?&amp;lt;col1&amp;gt;[^\\\]+)\\\(?&amp;lt;col2&amp;gt;[^\\\]+)\\\(?&amp;lt;col3&amp;gt;[^\\\]+)\\\(?&amp;lt;col4&amp;gt;.+)"
| table col1 col2 col3 col4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526599#M148633</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T10:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526608#M148637</link>
      <description>&lt;P&gt;Throws an error...&lt;/P&gt;&lt;P&gt;Regex: missing terminating for character class.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:17:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526608#M148637</guid>
      <dc:creator>tsm0099</dc:creator>
      <dc:date>2020-10-27T09:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526610#M148638</link>
      <description>&lt;P&gt;Try your data and the rex expression at regex101.com to see where the error is coming from.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526610#M148638</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T09:26:47Z</dc:date>
    </item>
    <item>
      <title>How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526614#M148639</link>
      <description>&lt;P&gt;It works fine in regex101...&lt;/P&gt;&lt;P&gt;But when i use it in splunk search it throws the error:&lt;/P&gt;&lt;P&gt;Encountered the following error while compiling the regex '&lt;SPAN&gt;(?&amp;lt;col1&amp;gt;[^\]+)\(?&amp;lt;col2&amp;gt;[^\&lt;/SPAN&gt;&lt;SPAN&gt;]+)\(?&amp;lt;col3&amp;gt;[^\]+)\(?&amp;lt;col4&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;.+)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: in the error regex i only see single \ instead of \\&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any idea about thia?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:59:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526614#M148639</guid>
      <dc:creator>tsm0099</dc:creator>
      <dc:date>2020-10-27T09:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526617#M148640</link>
      <description>&lt;P&gt;You need \\ in regex and \\\ in splunk&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1603793912587.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11515i84C8F44541C09337/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1603793912587.png" alt="ITWhisperer_0-1603793912587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="abc\\xyz\\pqr\\efg"
| rex "(?&amp;lt;col1&amp;gt;[^\\\]+)\\\(?&amp;lt;col2&amp;gt;[^\\\]+)\\\(?&amp;lt;col3&amp;gt;[^\\\]+)\\\(?&amp;lt;col4&amp;gt;.+)"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1603794333524.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/11516iE2AE168CA6C95F8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1603794333524.png" alt="ITWhisperer_0-1603794333524.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526617#M148640</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T10:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract json values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526625#M148644</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw |eval _raw="{
\"timestamp\": 157281937,
\"message\":\"abc\xyz\pqr\efg\",
}"
| rex mode=sed "s/,\s+}/}/g s/\\\/#/g"
| spath message
| rex field=message "(?&amp;lt;col1&amp;gt;\w+)#(?&amp;lt;col2&amp;gt;\w+)#(?&amp;lt;col3&amp;gt;\w+)#(?&amp;lt;col4&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;Why don't you change the characters?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-json-values/m-p/526625#M148644</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-10-27T10:48:55Z</dc:date>
    </item>
  </channel>
</rss>

