Basic Usage
Flags
Searching
-n reads back the tail of the journal, so an error from a while ago falls off
the end. -g searches the whole journal instead: it returns the last -n
entries that match, however far back they are.
The journal itself is capped at 200 MB per pod (in files of up to 25 MB). Once it is
full, the oldest entries are deleted to make room, so a search reaches back as far as the last
200 MB of logs. A very chatty app keeps less history than a quiet one. Logs you need to keep
for longer belong in a file or an external logging service.
- The pattern is a regex (PCRE), matched against the message text —
error|fatal,5\d\d,user_id=42all work. Quote it so your shell doesn’t expand it first. - Case follows the pattern. An all-lowercase pattern matches
case-insensitively; one uppercase character makes it case-sensitive. So
-g errorfindsErrorandERROR, while-g Errorfinds onlyError. - Matches print newest first, the opposite order to an unfiltered read.
instapods logs my-app on a Node.js pod reads
the app unit, but the kernel’s OOM-killer lines and nginx’s 502s live in other
units — exactly the things you search for because you can’t see them. Add -s
to scope a search to one service.
-- No entries -- means the search ran and nothing matched.
Examples
Service Filters
The available service filters depend on the pod’s preset:
If you’ve installed database services, their logs are also available: