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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...