<?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 Index JSON data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156570#M44037</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I would like to index JSON data like this, My ultimate aim is to move the fields(college, university, examdate) to the individual array element and index.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; college=college1    studentname=name1    mark=98    subject=science    university=university1    examdate=10-12-14
 college=college1    studentname=name2    mark=99    subject=science    university=university1    examdate=10-12-14
 college=college2    studentname=name21    mark=80    subject=science    university=university1    examdate=10-12-14
 college=college2    studentname=name22    mark=100    subject=science    university=university1   examdate=10-12-14
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample JSON,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
   "studentsmarks": {
     "subject": "science",
     "university": "university1",
     "examdate": "10-12-14"
   },
   "students": [
     {
       "college": "college1",
       "studentname": "name1",
       "mark": "98"
     },
     {
       "college": "college1",
       "studentname": "name2",
       "mark": "99"
     },
     {
       "college": "college2",
       "studentname": "name21",
       "mark": "80"
     },
     {
       "college": "college2",
       "studentname": "name22",
       "mark": "100"
     }
   ]
 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheeerrss!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Dec 2014 04:51:45 GMT</pubDate>
    <dc:creator>vasanthmss</dc:creator>
    <dc:date>2014-12-11T04:51:45Z</dc:date>
    <item>
      <title>Index JSON data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156570#M44037</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I would like to index JSON data like this, My ultimate aim is to move the fields(college, university, examdate) to the individual array element and index.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; college=college1    studentname=name1    mark=98    subject=science    university=university1    examdate=10-12-14
 college=college1    studentname=name2    mark=99    subject=science    university=university1    examdate=10-12-14
 college=college2    studentname=name21    mark=80    subject=science    university=university1    examdate=10-12-14
 college=college2    studentname=name22    mark=100    subject=science    university=university1   examdate=10-12-14
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample JSON,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
   "studentsmarks": {
     "subject": "science",
     "university": "university1",
     "examdate": "10-12-14"
   },
   "students": [
     {
       "college": "college1",
       "studentname": "name1",
       "mark": "98"
     },
     {
       "college": "college1",
       "studentname": "name2",
       "mark": "99"
     },
     {
       "college": "college2",
       "studentname": "name21",
       "mark": "80"
     },
     {
       "college": "college2",
       "studentname": "name22",
       "mark": "100"
     }
   ]
 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Cheeerrss!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 04:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156570#M44037</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2014-12-11T04:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Index JSON data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156571#M44038</link>
      <description>&lt;P&gt;run this search :&lt;BR /&gt;
&lt;CODE&gt;| gentimes start=-1 | eval temp="{\"studentsmarks\":{\"subject\":\"science\",\"university\":\"university1\",\"examdate\":\"10-12-14\"},\"students\":[{\"college\":\"college1\",\"studentname\":\"name1\",\"mark\":\"98\"},{\"college\":\"college1\",\"studentname\":\"name2\",\"mark\":\"99\"},{\"college\":\"college2\",\"studentname\":\"name21\",\"mark\":\"80\"},{\"college\":\"college2\",\"studentname\":\"name22\",\"mark\":\"100\"}]}" | table temp | rename temp as _raw | spath | rename students{}.* as * |rename studentsmarks.* as * | eval temp=mvzip(college,mvzip(mark,studentname,"#"),"#") | mvexpand temp | rex field=temp "(?.*)#(?.*)#(?.*)" |table college university examdate | outputcsv your_csv_name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;after go to   /splunk_home/var/run/splunk/   directry  and  you shall see   your_csv_name.csv ;&lt;BR /&gt;
Then you Recuper in the directory your csv file and  you can index your_csv_name.csv  file&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:22:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156571#M44038</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2020-09-28T18:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Index JSON data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156572#M44039</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;How this will help me? are you ask me to index twice? then what happen to the license? &lt;/P&gt;

&lt;P&gt;I would like to handle it in index time.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2014 19:02:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-JSON-data/m-p/156572#M44039</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2014-12-16T19:02:37Z</dc:date>
    </item>
  </channel>
</rss>

