<?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: extract values from a json like string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507712#M141922</link>
    <description>&lt;P&gt;index=mysearchIndex | table message | rex "status \{\nvalue: \"(?&amp;lt;status&amp;gt;\w+)" | table status&lt;/P&gt;&lt;P&gt;Here - message contains contains the string like below:&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;mydata {&lt;BR /&gt;name {&lt;BR /&gt;value: "1111"&lt;BR /&gt;}&lt;BR /&gt;id {&lt;BR /&gt;value: "2020-07-02 15:49:00"&lt;BR /&gt;}&lt;BR /&gt;status {&lt;BR /&gt;value: "Active"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 00:39:23 GMT</pubDate>
    <dc:creator>kotig</dc:creator>
    <dc:date>2020-07-07T00:39:23Z</dc:date>
    <item>
      <title>How to extract values from a JSON like string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507642#M141907</link>
      <description>&lt;P&gt;I am having data like this in my Splunk and I wanted to extract the value of status which is Active.&lt;/P&gt;&lt;P&gt;How can I do it when this is not a valid JSON string?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mydata {
name {
value: "1111"
}
id {
value: "2020-07-02 15:49:00"
}
status {
value: "Active"
}
}
Any help is appreciated.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 19:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507642#M141907</guid>
      <dc:creator>kotig</dc:creator>
      <dc:date>2020-07-06T19:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507649#M141911</link>
      <description>&lt;P&gt;Assuming that's all one event, then &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; should do the job.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | rex "status \{\nvalue: \"(?&amp;lt;status&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 18:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507649#M141911</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-06T18:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507658#M141913</link>
      <description>&lt;P&gt;yea i tried the rex. But it did not work. What i did was search splunk and put them into a table and then tried the rex as mentioned above but i had no luck.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 19:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507658#M141913</guid>
      <dc:creator>kotig</dc:creator>
      <dc:date>2020-07-06T19:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507667#M141915</link>
      <description>Please elaborate. What search did you use? What does the table look like? What rex did you try?</description>
      <pubDate>Mon, 06 Jul 2020 20:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507667#M141915</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-06T20:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507712#M141922</link>
      <description>&lt;P&gt;index=mysearchIndex | table message | rex "status \{\nvalue: \"(?&amp;lt;status&amp;gt;\w+)" | table status&lt;/P&gt;&lt;P&gt;Here - message contains contains the string like below:&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;mydata {&lt;BR /&gt;name {&lt;BR /&gt;value: "1111"&lt;BR /&gt;}&lt;BR /&gt;id {&lt;BR /&gt;value: "2020-07-02 15:49:00"&lt;BR /&gt;}&lt;BR /&gt;status {&lt;BR /&gt;value: "Active"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 00:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507712#M141922</guid>
      <dc:creator>kotig</dc:creator>
      <dc:date>2020-07-07T00:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507716#M141924</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/123711"&gt;@kotig&lt;/a&gt;&amp;nbsp;You are not specifying field=message in the rex command, so it is looking at _raw which no longer exists after your table message statement&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval message="mydata {
name {
value: \"1111\"
}
id {
value: \"2020-07-02 15:49:00\"
}
status {
value: \"Active\"
}
}"
| rex field=message "status \{\nvalue: \"(?&amp;lt;status&amp;gt;\w+)" | table status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 00:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507716#M141924</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-07T00:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: extract values from a json like string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507720#M141926</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;. That worked.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 01:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-JSON-like-string/m-p/507720#M141926</guid>
      <dc:creator>kotig</dc:creator>
      <dc:date>2020-07-07T01:05:15Z</dc:date>
    </item>
  </channel>
</rss>

