<?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 convert data in string format to json in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651710#M225285</link>
    <description>&lt;P&gt;is there any function available in splunk which converts the data in string format to json, which is actually json data but missing quotations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json payload.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26424i19E22DCAC0714400/image-size/large?v=v2&amp;amp;px=999" role="button" title="json payload.PNG" alt="json payload.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{uiType:Picker,model:{type:field,name:options_for_teams},plainTextMessage:Please select an option from the below list.,uiMetadata:{label:Please select an option from the below list.,itemType:ID,style:list,options:[{label:Create Service Request,value:Create Service Request,renderStyle:data,enabled:false},{label:Report an Incident,value:Report an Incident,renderStyle:data,enabled:false},{label:Check Incident/Request Status,value:Check Incident/Request Status,renderStyle:data,enabled:false},{label:Self-Service Knowledge Article,value:Self-Service Knowledge Article,renderStyle:data,enabled:false},{label:Submit your pending surveys,value:Submit your pending surveys,renderStyle:data,enabled:false},{label:Chat with Live Agent,value:Chat with Live Agent,renderStyle:data,enabled:false},{label:My Pending Approvals,value:My Pending Approvals,renderStyle:data,enabled:false},{label:Password Reset,value:Password Reset,renderStyle:data,enabled:false},{label:View My Assets,value:View My Assets,renderStyle:data,enabled:false},{label:Create An Emergency Change,value:Create An Emergency Change,renderStyle:data,enabled:false}],multiSelect:false,openByDefault:true,required:true,maskType:NONE,totalOptionsCount:10,totalSearchResultsCount:0,paginationBreak:-1},nluTextEnabled:false,value:View My Assets}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added the payload string for reference.&lt;/P&gt;&lt;P&gt;since this payload is in string format, i'm unable to use spath command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2023 08:19:13 GMT</pubDate>
    <dc:creator>AnilPujar</dc:creator>
    <dc:date>2023-07-24T08:19:13Z</dc:date>
    <item>
      <title>convert data in string format to json</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651710#M225285</link>
      <description>&lt;P&gt;is there any function available in splunk which converts the data in string format to json, which is actually json data but missing quotations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="json payload.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26424i19E22DCAC0714400/image-size/large?v=v2&amp;amp;px=999" role="button" title="json payload.PNG" alt="json payload.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{uiType:Picker,model:{type:field,name:options_for_teams},plainTextMessage:Please select an option from the below list.,uiMetadata:{label:Please select an option from the below list.,itemType:ID,style:list,options:[{label:Create Service Request,value:Create Service Request,renderStyle:data,enabled:false},{label:Report an Incident,value:Report an Incident,renderStyle:data,enabled:false},{label:Check Incident/Request Status,value:Check Incident/Request Status,renderStyle:data,enabled:false},{label:Self-Service Knowledge Article,value:Self-Service Knowledge Article,renderStyle:data,enabled:false},{label:Submit your pending surveys,value:Submit your pending surveys,renderStyle:data,enabled:false},{label:Chat with Live Agent,value:Chat with Live Agent,renderStyle:data,enabled:false},{label:My Pending Approvals,value:My Pending Approvals,renderStyle:data,enabled:false},{label:Password Reset,value:Password Reset,renderStyle:data,enabled:false},{label:View My Assets,value:View My Assets,renderStyle:data,enabled:false},{label:Create An Emergency Change,value:Create An Emergency Change,renderStyle:data,enabled:false}],multiSelect:false,openByDefault:true,required:true,maskType:NONE,totalOptionsCount:10,totalSearchResultsCount:0,paginationBreak:-1},nluTextEnabled:false,value:View My Assets}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;added the payload string for reference.&lt;/P&gt;&lt;P&gt;since this payload is in string format, i'm unable to use spath command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 08:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651710#M225285</guid>
      <dc:creator>AnilPujar</dc:creator>
      <dc:date>2023-07-24T08:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: convert data in string format to json</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651744#M225292</link>
      <description>&lt;P&gt;Try something like this - it appears to work with the example given&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/(?&amp;lt;delimiter&amp;gt;[\{,\[]+)?(?&amp;lt;key&amp;gt;\w+):(?&amp;lt;value&amp;gt;([\{\[]+|[^,\}]+))(?&amp;lt;close&amp;gt;[\}\],]+)?/\1\"\2\":\"\4\"\5/g s/\"(?&amp;lt;opening&amp;gt;[{\[]+)\"/\1/g"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jul 2023 09:57:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651744#M225292</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-24T09:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: convert data in string format to json</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651745#M225293</link>
      <description>&lt;P&gt;Having said that, you may want to extend it to unquote the numerics&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 09:57:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651745#M225293</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-24T09:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: convert data in string format to json</title>
      <link>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651746#M225294</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Thanks this helped at a certain level, it's adding quotations in some payload data where it contains URLs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 10:04:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/convert-data-in-string-format-to-json/m-p/651746#M225294</guid>
      <dc:creator>AnilPujar</dc:creator>
      <dc:date>2023-07-24T10:04:57Z</dc:date>
    </item>
  </channel>
</rss>

