Getting Data In

What are the steps to configure Splunk to parse and index JSON data?

chaseto
Explorer

Hello Experts,

I am very new to Splunk. I can import data into Splunk from .csv file by:
add data->select source->sourcetype(access_combined)->next and click save.
I can view the data by searching by giving the correct index and source name.

In the same way, what is the process for JSON data? Can anyone explain me the detail steps of it starting from the props.conf?

Below is the sample data which I have

{"version":"2.4","user":{"zipCode":"","pcnNumber":""},"event":[{"eventInfo":{"eventAction":"start","eventType":"cardApplication"},"productInfo":[{"productName":"DeltaGold","pmc":"113"}]}],"page":{"attributes":{"rbpnIndicator":"","preApproval":"NPA","appCache":"","appType":"Co-Brand","channel":"Non-DTW","rwd":"desktop","appConfig":"","experience":"Microsite","partner":"dal","acqCardType":"CCSG","appDecision":"","partnerAppType":"Co-Brand","acqExperience":"Microsite","productInfo":[{"productName":"DeltaGold","pmc":"113"}],"applicationId":"CPI_WEB","formName":"appForm","tool":"","autotrack":false,"appLength":"Long","decisionIndicator":"","flowType":"Prospect","sid":"2s0Hfr1lhsBhm8ad3hw01C2"},"pageInfo":{"country":"US","language":"en","pageID":"ng31hcrmnnh11zp","pageName":"DeltaGold_StartApp"},"category":{"primaryCategory":"Acq","subCategory1":"CCSG","subCategory2":"Microsite","businessUnit":"AMEX","subCategory3":"CPI"}}}

In the above data, do I get a separate field for each separated by semicolon and separate fields for the one which are there in the flower brackets?
example: "event":[{"eventInfo":{"eventAction":"start","eventType":"cardApplication"}

Sorry for such a big question and thank you in advance

pramit46
Contributor

I would add the following line under the respective sourcetype stanza.

kv_mode=json

or use spath in the query.

0 Karma

mkemmerer
Explorer

spath is probably going to work best since you've got arrays in your data. Searching through arrays of objects can get a bit ugly in my experience.

0 Karma

chaseto
Explorer

so are you saying once the data is in splunk, instead of regurlar search using spath gives a clear picture..right?

0 Karma

chaseto
Explorer

Thank You for the response .I figured how the process is done,on the other side I want know does it have seperate fields for the one which is in the flower brackets

"event":[{"eventInfo":{"eventAction":"start","eventType":"cardApplication"}

like eventAction and eventType in two different fields.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...