Splunk Search

Translate splunk data to json using cli search?

zsbbb
Engager

I have a splunk container running on docker, and was hoping to translate the splunk index data into json using a cli search and saving the output as a local file. How to do this?

Thanks in advance!

Labels (1)
Tags (3)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Maybe you can clarify "translate the splunk index data."  Do you mean to dump raw Splunk data into JSON?  How is that useful?

In any case, you can always use tojson command after any search you do.  For example,

splunk search "index=_* earliest=-4h |stats count by index |tojson" >count.json

 

0 Karma
Get Updates on the Splunk Community!

Don't wait! Accept the Mission Possible: Splunk Adoption Challenge Now and Win ...

Attention everyone! We have exciting news to share! We are recruiting new members for the Mission Possible: ...

Unify Your SecOps with Splunk Mission Control

In today’s post, I'm excited to share some recent Splunk Mission Control innovations. With Splunk Mission ...

Data Preparation Made Easy: SPL2 for Edge Processor

By now, you may have heard the exciting news that Edge Processor, the easy-to-use Splunk data preparation tool ...