Modify `promtail` config for `sudo` logs.
This commit is contained in:
parent
57d21b0a40
commit
6b7b0a0844
|
@ -32,7 +32,7 @@ scrape_configs:
|
|||
selector: '{job="sudo"} |~ "/bin/sh"'
|
||||
stages:
|
||||
- drop:
|
||||
expression: (CRON|sshd|session)
|
||||
expression: (CRON|sshd|session|securetty)
|
||||
- regex:
|
||||
expression: '^(?P<timestamp>\w+ +[0-9]+ [0-9]+:[0-9]+:[0-9]+) [^ ]+ sudo: +(?P<user>[^ ]+) : TTY=(?P<tty>[^ ]+) ; PWD=(?P<pwd>[^ ]+) ; USER=(?P<foo>[^ ]+) ; COMMAND=(?P<cmd>.+)$'
|
||||
|
||||
|
@ -59,7 +59,7 @@ scrape_configs:
|
|||
selector: '{job="sudo"} !~ "/bin/sh"'
|
||||
stages:
|
||||
- drop:
|
||||
expression: (CRON|sshd|session)
|
||||
expression: (CRON|sshd|session|securetty)
|
||||
- regex:
|
||||
expression: '^(?P<timestamp>\w+ +[0-9]+ [0-9]+:[0-9]+:[0-9]+) [^ ]+ sudo: +(?P<user>[^ ]+) : TTY=(?P<tty>[^ ]+) ; PWD=(?P<pwd>[^ ]+) ; USER=(?P<foo>[^ ]+) ; COMMAND=(?P<cmd>.+)$'
|
||||
|
||||
|
|
Loading…
Reference in New Issue