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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...