Getting Data In

How to use props.conf to parse json file in splunk

camellia
Engager

Hi

I am new to splunk. I set up a single-site cluster to parse a JSON-formatted log. I use cm in the path of /opt/splunk/etc/manager-apps/_cluster/local. conf and transforms.conf configuration files were sent to index in the path /opt/splunk/etc/peer-apps/_cluster/local. However, when I searched in the search header, the desired effect was not found.

props.conf

[itsd]
DATETIME_CONFIG = CURRENT
KV_MODE = json
LINE_BREAKER = ([\r\n]+)
category = Structured
disabled = false
pulldown_type = true
TRANSFORMS-null1 = replace_null
TRANSFORMS-null2 = replace_null1

 

transforms.conf

[replace_null]
REGEX = ^\[
DEST_KEY=queue
FORMAT=nullQueue

[replace_null1]
REGEX=(.*)(\}\s?\})
DEST_KEY=_raw
FORMAT=$1$2

Labels (2)
0 Karma
1 Solution

manjunathmeti
Champion

hi @camellia,

You need to configure these in the forwarder not on the indexer servers. Also,  KV_MODE = json is search time configuration, not index-time configuration.

Set INDEXED_EXTRACTIONS = JSON for your sourcetype in props.conf. Deploy props.conf and transforms.conf in your forwarder.

[itsd]
DATETIME_CONFIG = CURRENT
INDEXED_EXTRACTIONS = JSON
LINE_BREAKER = ([\r\n]+)
category = Structured
disabled = false
pulldown_type = true
TRANSFORMS-null1 = replace_null
TRANSFORMS-null2 = replace_null1

 

View solution in original post

manjunathmeti
Champion

hi @camellia,

You need to configure these in the forwarder not on the indexer servers. Also,  KV_MODE = json is search time configuration, not index-time configuration.

Set INDEXED_EXTRACTIONS = JSON for your sourcetype in props.conf. Deploy props.conf and transforms.conf in your forwarder.

[itsd]
DATETIME_CONFIG = CURRENT
INDEXED_EXTRACTIONS = JSON
LINE_BREAKER = ([\r\n]+)
category = Structured
disabled = false
pulldown_type = true
TRANSFORMS-null1 = replace_null
TRANSFORMS-null2 = replace_null1

 

Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...