KakaoluKekAdam
Yetkin
Bütün servis loglarını export etmek için:
Belirli bir servisin loglarını export etmek için:
Zaman aralığına göre log export:
Sadece son boot logları:
Sadece hata logları (error ve üstü):
JSON formatında export:
Canlı logları dosyaya yazma:
Kullanıcı (user) servis logları:
Kernel logları (dmesg yerine):
Zamanlı:
PID’ye göre log çekme
Belirli bir process için:
Executable’a göre log
Hangi binary yazmış görmek için:
UID’ye göre log
Bir kullanıcının tüm logları:
TTY / SSH oturum logları:
Priority aralığı:
Tag / identifier ile:
Output formatları
Kısa tek satır:
Verbose (field’lar dahil):
Reverse (sondan başa):
Diskteki journal dosyalarını direkt export
Tüm machine-id:
Sıkıştırarak export (tek satır):
En ağır debug modu:
Grepleme (Filtreleme):
Log Boyutunu Sınırlama:
Field Bazlı JSON Çıktısı:
Kod:
sudo journalctl > /home/$USER/journalctl.log
Belirli bir servisin loglarını export etmek için:
Kod:
sudo journalctl -u nginx > /home/$USER/nginx.log
Zaman aralığına göre log export:
Kod:
sudo journalctl --since "2026-01-10 00:00:00" --until "2026-01-11 12:00:00" > /home/$USER/logs.log
Sadece son boot logları:
Kod:
sudo journalctl -b > /home/$USER/boot.log
Sadece hata logları (error ve üstü):
Kod:
sudo journalctl -p err > /home/$USER/errors.log
JSON formatında export:
Kod:
sudo journalctl -o json-pretty > /home/$USER/journalctl.json
Canlı logları dosyaya yazma:
Kod:
sudo journalctl -f > /home/$USER/live.log
Kullanıcı (user) servis logları:
Kod:
journalctl --user > /home/$USER/user.log
Kernel logları (dmesg yerine):
Kod:
sudo journalctl -k > /home/$USER/kernel.log
Zamanlı:
Kod:
sudo journalctl -k --since today > /home/$USER/kernel_today.log
PID’ye göre log çekme
Belirli bir process için:
Kod:
sudo journalctl _PID=1234 > /home/$USER/pid_1234.log
Executable’a göre log
Hangi binary yazmış görmek için:
Kod:
sudo journalctl _EXE=/usr/bin/nginx > /home/$USER/nginx_exe.log
UID’ye göre log
Bir kullanıcının tüm logları:
Kod:
sudo journalctl _UID=1000 > /home/$USER/user_1000.log
TTY / SSH oturum logları:
Kod:
sudo journalctl _COMM=sshd > /home/$USER/ssh.log
Priority aralığı:
Kod:
sudo journalctl -p warning..crit > /home/$USER/warn_crit.log
Tag / identifier ile:
Kod:
sudo journalctl -t NetworkManager > /home/$USER/nm.log
Output formatları
Kısa tek satır:
Kod:
sudo journalctl -o short-iso > /home/$USER/short.log
Verbose (field’lar dahil):
Kod:
sudo journalctl -o verbose > /home/$USER/verbose.log
Reverse (sondan başa):
Kod:
sudo journalctl -r > /home/$USER/reverse.log
Diskteki journal dosyalarını direkt export
Tüm machine-id:
Kod:
sudo journalctl --directory=/var/log/journal > /home/$USER/full.log
Sıkıştırarak export (tek satır):
Kod:
sudo journalctl | gzip > /home/$USER/journal.log.gz
En ağır debug modu:
Kod:
sudo journalctl -p debug > /home/$USER/debug.log
Grepleme (Filtreleme):
Kod:
sudo journalctl | grep -i "failed" > /home/$USER/failed_attempts.log
Log Boyutunu Sınırlama:
Kod:
sudo journalctl -n 1000 > /home/$USER/last_1000.log
Field Bazlı JSON Çıktısı:
Kod:
sudo journalctl -o json | jq ' { "_SOURCE_REALTIME_TIMESTAMP", "MESSAGE", "_SYSTEMD_UNIT" }' > /home/$USER/minimal.json