<?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 convert multiple individual json objects into a nested json object ? in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-convert-multiple-individual-json-objects-into-a-nested/m-p/644882#M330</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244097"&gt;@damode1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| spath 
| eval EventData = json_object("FileVersion", FileVersion,"Company",Company, "TerminalSessionId",TerminalSessionId, "UtcTime",UtcTime, "Product",Product) 
| eval NewJson = json_object("ID",ID, "Timestamp", Timestamp,"EventData",json(EventData))
| table _raw NewJson&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="{\"ID\": 1,\"Timestamp\": \"2023-05-18T05:07:59.940594300Z\",\"FileVersion\": \"10.0.17134.1 (WinBuild.160101.0800)\",\"Company\": \"Microsoft Corporation\",\"TerminalSessionId\": 0,\"UtcTime\": \"2018-08-20 15:18:59.929\",\"Product\": \"Microsoft® Windows® Operating System\",}" 
| spath 
| eval EventData = json_object("FileVersion", FileVersion,"Company",Company, "TerminalSessionId",TerminalSessionId, "UtcTime",UtcTime, "Product",Product) 
| eval NewJson = json_object("ID",ID, "Timestamp", Timestamp,"EventData",json(EventData))
| table _raw NewJson&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="Screenshot 2023-05-29 at 12.18.16 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25580iB5E7FF65189E61DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-05-29 at 12.18.16 PM.png" alt="Screenshot 2023-05-29 at 12.18.16 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2023 06:49:13 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2023-05-29T06:49:13Z</dc:date>
    <item>
      <title>How to convert multiple individual json objects into a nested json object ?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-convert-multiple-individual-json-objects-into-a-nested/m-p/644047#M329</link>
      <description>&lt;P&gt;I want to convert some of the below individual json objects in the event into nested single json object like the second example&lt;/P&gt;&lt;P&gt;Current Format&lt;/P&gt;&lt;PRE&gt;{
    "ID": 1,
    "Timestamp": "2023-05-18T05:07:59.940594300Z",
    "FileVersion": "10.0.17134.1 (WinBuild.160101.0800)",
    "Company": "Microsoft Corporation",
    "TerminalSessionId": 0,
    "UtcTime": "2018-08-20 15:18:59.929",
    "Product": "Microsoft® Windows® Operating System",
}&lt;/PRE&gt;&lt;P&gt;Expected Format&lt;/P&gt;&lt;PRE&gt;{
    "ID": 1,
    "Timestamp": "2023-05-18T05:07:59.940594300Z",
    "EventData":{
        "FileVersion": "10.0.17134.1 (WinBuild.160101.0800)",
        "Company": "Microsoft Corporation",
        "TerminalSessionId": 0,
        "UtcTime": "2018-08-20 15:18:59.929",
        "Product": "Microsoft® Windows® Operating System",
    }
}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I have tried to playaround with json functions but unable to figure out how to achieve the above outcome.&lt;/P&gt;&lt;P&gt;Can someone please help ?&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2023 23:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-convert-multiple-individual-json-objects-into-a-nested/m-p/644047#M329</guid>
      <dc:creator>damode1</dc:creator>
      <dc:date>2023-05-21T23:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert multiple individual json objects into a nested json object ?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-convert-multiple-individual-json-objects-into-a-nested/m-p/644882#M330</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244097"&gt;@damode1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| spath 
| eval EventData = json_object("FileVersion", FileVersion,"Company",Company, "TerminalSessionId",TerminalSessionId, "UtcTime",UtcTime, "Product",Product) 
| eval NewJson = json_object("ID",ID, "Timestamp", Timestamp,"EventData",json(EventData))
| table _raw NewJson&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="{\"ID\": 1,\"Timestamp\": \"2023-05-18T05:07:59.940594300Z\",\"FileVersion\": \"10.0.17134.1 (WinBuild.160101.0800)\",\"Company\": \"Microsoft Corporation\",\"TerminalSessionId\": 0,\"UtcTime\": \"2018-08-20 15:18:59.929\",\"Product\": \"Microsoft® Windows® Operating System\",}" 
| spath 
| eval EventData = json_object("FileVersion", FileVersion,"Company",Company, "TerminalSessionId",TerminalSessionId, "UtcTime",UtcTime, "Product",Product) 
| eval NewJson = json_object("ID",ID, "Timestamp", Timestamp,"EventData",json(EventData))
| table _raw NewJson&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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="Screenshot 2023-05-29 at 12.18.16 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25580iB5E7FF65189E61DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-05-29 at 12.18.16 PM.png" alt="Screenshot 2023-05-29 at 12.18.16 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 06:49:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-convert-multiple-individual-json-objects-into-a-nested/m-p/644882#M330</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2023-05-29T06:49:13Z</dc:date>
    </item>
  </channel>
</rss>

