<?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 do coul I read / tranform string in json data? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382500#M6014</link>
    <description>&lt;P&gt;I am not quite sure but let us try this. In this case I will try to extract  the 'id' field. Now, in this sample that you have provided, id has 2 distinct values, so  if we try this &lt;CODE&gt;&amp;lt;your search&amp;gt;| rex field=_raw "id\"+\:+\"(?&amp;lt;id&amp;gt;.*?)\"+" max_match=0|table id&lt;/CODE&gt;&lt;BR /&gt;
you should ideally receive an id column with the 2 different id values as rows. Now, is that something similar to what you want? I have taken id as an example here but you want the same for different fields, like application name, country, OS etc?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jun 2018 12:35:44 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2018-06-15T12:35:44Z</dc:date>
    <item>
      <title>how do coul I read / tranform string in json data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382497#M6011</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I index some logs in JSON format.&lt;BR /&gt;
I manage to access JSON field with:&lt;BR /&gt;
search| spath "jsonfield" | search "jsondield"= "value"&lt;/P&gt;

&lt;P&gt;My problem is on a specific field in my json:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Json exemple:&lt;/STRONG&gt;&lt;BR /&gt;
[{"source":"mySource","id":"2dc3cdf1-6e3c-11e8-8240-06db4a62e7d6","recorded":"2018-12-06T12:28:57.970Z","action":null,"actors":[{"type":"user","name":"username","id":null}],"resources":[],"client":null,"result":{"status":"POLICY","message":"Authentication Details:\nIP Address: 255.255.255.255\nCountry: FR\nNew Device: true\nRequested Application ID: &lt;A href="https://www.myapplication.com/%5CnRequested"&gt;https://www.myapplication.com/\nRequested&lt;/A&gt; Application Name: N/A\nPassword Reset: false\nSelf Service Device Management: false\nTime since last Authentication: N/A\nTime since last Authentication from Office: N/A\nMobile OS Version: N/A\nDevice Model: N/A\nDevice Lock Enabled: N/A\nDevice Rooted or Jailbroken: N/A\nDevice enrolled in MDM: N/A\nPingID App Version: N/A\nAction: MyAction\nPolicy Met: Default Policy\nRule Met: \"Default Action\"\n"}},{"source":"mySource","id":"33db40d4-6e3c-11e8-8240-06db4a62e7d6","recorded":"2018-12-06T12:29:08.190Z","action":null,"actors":[{"type":"user","name":"username","id":null}],"resources":[],"client":null,"result":{"status":"SUCCESS","message":"SSO myKey \"myKey 1\""}}]&lt;/P&gt;

&lt;P&gt;In result.message field, Splunk read string but i would like to exctract fields.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Exemple, I woulrd like to extract:&lt;/STRONG&gt;&lt;BR /&gt;
Application Name&lt;BR /&gt;
Country&lt;BR /&gt;
Mobile Os Version&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;How could I do that?&lt;/P&gt;

&lt;P&gt;I can't change json format (I don't manage the app who send it to me...)&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 12:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382497#M6011</guid>
      <dc:creator>simounth</dc:creator>
      <dc:date>2018-06-13T12:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: how do coul I read / tranform string in json data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382498#M6012</link>
      <description>&lt;P&gt;the example json string that you have cited above..does it come as one single event?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382498#M6012</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-15T12:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: how do coul I read / tranform string in json data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382499#M6013</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thanks for your answer.&lt;BR /&gt;
I'm not sure to understand your question.&lt;/P&gt;

&lt;P&gt;I'll try to answer.&lt;BR /&gt;
In fact I poll logs from an app in SaaS.&lt;/P&gt;

&lt;P&gt;The json I cited is when a single user do an action.&lt;BR /&gt;
But If many users did actions when i poll logs, the json will contains all events.&lt;/P&gt;

&lt;P&gt;Is it ok for you?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382499#M6013</guid>
      <dc:creator>simounth</dc:creator>
      <dc:date>2018-06-15T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: how do coul I read / tranform string in json data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382500#M6014</link>
      <description>&lt;P&gt;I am not quite sure but let us try this. In this case I will try to extract  the 'id' field. Now, in this sample that you have provided, id has 2 distinct values, so  if we try this &lt;CODE&gt;&amp;lt;your search&amp;gt;| rex field=_raw "id\"+\:+\"(?&amp;lt;id&amp;gt;.*?)\"+" max_match=0|table id&lt;/CODE&gt;&lt;BR /&gt;
you should ideally receive an id column with the 2 different id values as rows. Now, is that something similar to what you want? I have taken id as an example here but you want the same for different fields, like application name, country, OS etc?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382500#M6014</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-15T12:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: how do coul I read / tranform string in json data?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382501#M6015</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;This should do the trick. Note that the names I used for the fields can of course be changed.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval message="Authentication Details:\nIP Address: 255.255.255.255\nCountry: FR\nNew Device: true\nRequested Application ID: &lt;A href="https://www.myapplication.com/\nRequested" target="test_blank"&gt;https://www.myapplication.com/\nRequested&lt;/A&gt; Application Name: N/A\nPassword Reset: false\nSelf Service Device Management: false\nTime since last Authentication: N/A\nTime since last Authentication from Office: N/A\nMobile OS Version: N/A\nDevice Model: N/A\nDevice Lock Enabled: N/A\nDevice Rooted or Jailbroken: N/A\nDevice enrolled in MDM: N/A\nPingID App Version: N/A\nAction: MyAction\nPolicy Met: Default Policy\nRule Met: \"Default Action\"\n"
| rex field=message "Country: (?&amp;lt;Country&amp;gt;\w+)"
| rex field=message "Application Name: (?&amp;lt;appName&amp;gt;[A-Z\/]+)"
| rex field=message "nMobile OS Version: (?&amp;lt;mobOsVer&amp;gt;[A-Z\/]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jun 2018 12:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/how-do-coul-I-read-tranform-string-in-json-data/m-p/382501#M6015</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-06-15T12:50:55Z</dc:date>
    </item>
  </channel>
</rss>

