You are not logged in.

#1 2013-01-02 20:37:30

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

[bash] redirect journalctl

hi to everybody,

i want to "open" the systemd log (i know and use the journalctl command) outside the terminal, outside the not comfortable pager.....

my idea is to simply use a text editor such as geany, but my little bash knowledge aren't enough to perform this task....can anyone help me?

thanks


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#2 2013-01-02 20:40:25

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: [bash] redirect journalctl

journalctl --no-pager

?


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#3 2013-01-02 20:45:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,363

Re: [bash] redirect journalctl

If your text editor supports reading from STDIN, you could do something like this:

PAGER="vim -" journalctl

Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#4 2013-01-03 03:34:54

dodo3773
Member
Registered: 2011-03-17
Posts: 798

Re: [bash] redirect journalctl

Something like this?:

$ export SYSTEMD_PAGER=cat
$ journalctl > /tmp/journal && geany /tmp/journal

Just put "export SYSTEMD_PAGER=cat" in your .zshrc (.bashrc whatever) if you don't want to use the systemd pager at all.

Last edited by dodo3773 (2013-01-03 03:35:56)

Offline

#5 2013-01-03 11:56:00

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [bash] redirect journalctl

thanks, following your suggestions:

journalctl --no-pager --this-boot > /tmp/log.log && geany /tmp/log.log

it works, but i think (i hope) exist a way to redirect the journalctl output into geany input, this trick should be perfect....


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#6 2013-01-03 12:08:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: [bash] redirect journalctl

Are you aware that you can use syslog with journald to produce legacy-style plain text logs? Might save you some of the hoop-jumping suggested above.

Offline

#7 2013-01-03 13:29:33

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: [bash] redirect journalctl

this could be an alternative solution, but in this way i make my (old) pc slower, since it's a second operation.... or not?


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

Board footer

Powered by FluxBB