Hi All, I would like to read Splunk indexed log/data using text editor tool (like Notepad, etc.). I understand Splunk indexed logs are compressed and further processed which creates a Splunk only readable format (Not-Human readable) - which works well for searching or other capabilities of Splunk.
But, wondering if there is way to convert these indexed logs into a human readable format?
You can use the "dump" Splunk command to export from the proprietary Splunk bucket format back in to Plain text using the following example:
Export all events from index "bigdata" to the location "YYYYmmdd/HH/host" at "$SPLUNK_HOME/var/run/splunk/dispatch/<sid>/dump/" directory on local disk with "MyExport" as the prefix of export filenames. Partitioning of the export data is achieved by eval preceding the dump command.
index=bigdata | eval _dstpath=strftime(_time, "%Y%m%d/%H") + "/" + host | dump basefilename=MyExport fields="_time, host, source, sourcetype"
For more info check out https://docs.splunk.com/Documentation/Splunk/9.4.1/SearchReference/Dump
You can also dump the data using the CLI instead of SPL if required - check out https://docs.splunk.com/Documentation/Splunk/9.4.0/Search/Exportdatausingdumpcommand
Once this is done you will be able to open the resulting file in a standard text editor.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
We must follow the outlined process to back up and restore the data. As mentioned, after restoration, you can query the data using the search head. However, it’s not feasible to directly export it into a human-readable format.
Hi Kiran,
Thanks for the replying.
Use case: I would like to backup indexed Splunk logs into a third party backup/restore system say on daily or weekly basis and it is required to be in human readable format. So they can be retrieved anytime in future within the backup/restore system and can be read with a notepad or other similar tool if needed
Would love to know your thoughts on above?
You can search them and see the raw data in the search window, you can export them as CSV files, but what's your use case? Seems like an odd thing to want to do... 🙂
Hey bowesmana,
Thanks for the replying.
Use case: I would like to backup indexed Splunk logs into a third party backup/restore system say on daily or weekly basis and it is required to be in human readable format. So they can be retrieved anytime in future within the backup/restore system and can be read with a notepad or other similar tool if needed
Would love to know your thoughts on above?
I think if this is the reason then you'd be better taking a feed of the data at ingestion time rather than extracting it out from Splunk.
You could use Ingest Actions to write to S3 or NFS which might be the easiest approach - Check out https://docs.splunk.com/Documentation/Splunk/9.4.1/Data/DataIngest#Create_an_NFS_file_system_destina...
Theres also a lunch & learn video at https://www.youtube.com/watch?v=9W_4ERKTx94 which gives an overview of Ingest Actions which might help you too.
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing