---
name: "qsexec"
section: "1"
platform: "linux"
package: "libapache2-mod-qos"
version: "11.63-1+b2"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/qsexec"
---

# qsexec(1)

parses the data received via stdin and executes the defined command on a pattern match.

## NAME

qsexec - parses the data received via stdin and executes the defined command on a pattern match.

## SYNOPSIS

qsexec -e \<pattern\> \[-t \<number\>:\<sec\>\] \[-c \<pattern\> \[\<command string\>\]\] \[-p\] \[-u \<user\>\] \<command string\>

## DESCRIPTION

qsexec reads log lines from stdin and searches for the defined pattern. It executes the defined command string on pattern match.

## OPTIONS

- \-e \<pattern\>

  Specifes the search pattern causing an event which shall trigger the command.

- \-t \<number\>:\<sec\>

  Defines the number of pattern match within the the defined number of seconds in order to trigger the command execution. By default, every pattern match causes a command execution.

- \-c \<pattern\> \[\<command string\>\]

  Pattern which clears the event counter. Executes optionally a command if an event command has been executed before.

- \-p

  Writes data also to stdout (for piped logging).

- \-u \<name\>

  Become another user, e.g. www-data.

- \<command string\>

  Defines the event command string where $0-$9 are substituted by the submatches of the regular expression.

## EXAMPLE

Executes the deny.sh script providing the IP address of the client causing a mod\_qos(031) messages whenever the log message appears 10 times within at most one minute: \
   ErrorLog "\|/usr/bin/qsexec -e \\'mod\_qos\\(031\\).\*, c=(\[0-9a-zA-Z:.\]\*)\\' -t 10:60 \\'/usr/local/bin/deny.sh $1\\'"

## SEE ALSO

qsdt(1), [qsfilter2(1)](/qsfilter2/1.md), [qsgeo(1)](/qsgeo/1.md), [qsgrep(1)](/qsgrep/1.md), qshead(1), [qslog(1)](/qslog/1.md), [qslogger(1)](/qslogger/1.md), [qspng(1)](/qspng/1.md), [qsre(1)](/qsre/1.md), [qsrespeed(1)](/qsrespeed/1.md), [qsrotate(1)](/qsrotate/1.md), [qssign(1)](/qssign/1.md), [qstail(1)](/qstail/1.md)

## AUTHOR

Pascal Buchbinder, http://mod-qos.sourceforge.net/
