47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, example, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | example | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tail_journal | function | bash | infra | 1.0.0 | impure | tail_journal(unit: string, lines: int=100, follow: bool=false, since: string="", priority: string="info") -> void | Wrapper sobre journalctl con formato consistente. Tail logs de una unidad systemd con coloreado, filtro por prioridad y seguimiento opcional. |
|
false | error_go_core |
|
Lineas de journalctl en formato short-iso, una por linea. Si follow=true, flujo continuo. | tail_journal registry-api 200 true | false | bash/functions/infra/tail_journal.sh |
Ejemplo
# Ver ultimas 100 lineas de un servicio
tail_journal caddy
# Seguimiento continuo con 50 lineas iniciales
tail_journal registry-api.service 50 true
# Solo errores de la ultima hora
tail_journal my-app 200 false "1 hour ago" err
# Con pipe (funciona sin bufferizado)
tail_journal registry-api 100 true "" warning | grep "ERROR"
Notas
Detecta automaticamente si la unit pertenece al usuario (systemctl --user) o al sistema (sudo journalctl). Si la unit no es de usuario, se llama con sudo — el usuario debe tener NOPASSWD para journalctl o sudo configurado.
Si follow=true, usa stdbuf -oL para deshabilitar el bufferizado de stdout, lo que permite piping en tiempo real (ej. tail_journal ... | grep pattern).
Exit codes: 1 unit no existe o no especificada, 2 prioridad invalida, 5 journalctl no disponible.
---