#Random
This is a place to discuss all things outside of Splunk, its products, and its use cases.

journal.gz

gizemk00
Engager

when we are using less command into the journal.gz we see that non-text characters like ascii character, what is the reason of this??

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

As @rich7177 said, usually *.gz files are compressed text files using gzip. If that is the case, do not use less but instead use zless:

zless journal.gz
zcat journal.gz
zmore journal.gz #Display journal.gz one screen at a time
zgrep '1.2.3.4' journal.gz # Search journal.gz for 1.2.3.4 IP address using grep command like syntax:
egrep 'regex' journal.gz
egrep 'regex1|regex2' journal.gz

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

Echoing @rich7177 and @woodcock and adding a little more detail.

(A) it's a compressed file. You have to uncompress it to read it. Sometimes less will silently decompress it for you.

(B) Even if you do uncompress it, there's going to be binary data in it. Splunk's journal file has your raw events along with binary metadata about them. What you'll see is clumps of plain text event, surrounded by clumps of binary. That is just how it is, because that is how Splunk stores the data.

0 Karma

woodcock
Esteemed Legend

As @rich7177 said, usually *.gz files are compressed text files using gzip. If that is the case, do not use less but instead use zless:

zless journal.gz
zcat journal.gz
zmore journal.gz #Display journal.gz one screen at a time
zgrep '1.2.3.4' journal.gz # Search journal.gz for 1.2.3.4 IP address using grep command like syntax:
egrep 'regex' journal.gz
egrep 'regex1|regex2' journal.gz

Richfez
SplunkTrust
SplunkTrust

gzip is a binary file type. There's some magic in how you can tell less to automatically "unzip" a gz file when it displays one, but it's not always turned on.

Not really being a Splunk questions, please refer to this Stack Overflow question for more information and a possible solution.

Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...