summaryrefslogtreecommitdiffstats
path: root/tools/man1/qsexec.1
diff options
context:
space:
mode:
Diffstat (limited to 'tools/man1/qsexec.1')
-rw-r--r--tools/man1/qsexec.136
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/man1/qsexec.1 b/tools/man1/qsexec.1
new file mode 100644
index 0000000..0ae6030
--- /dev/null
+++ b/tools/man1/qsexec.1
@@ -0,0 +1,36 @@
+.TH QSEXEC 1 "May 2023" "mod_qos utilities 11.74" "qsexec man page
+
+.SH NAME
+qsexec \- parses the data received via stdin and executes the defined command on a pattern match.
+
+.SH SYNOPSIS
+qsexec \-e <pattern> [\-t <number>:<sec>] [\-c <pattern> [<command string>]] [\-p] [\-u <user>] <command string>
+.SH DESCRIPTION
+qsexec reads log lines from stdin and searches for the defined pattern. It executes the defined command string on pattern match.
+.SH OPTIONS
+.TP
+\-e <pattern>
+Specifies the search pattern causing an event which shall trigger the command.
+.TP
+\-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.
+.TP
+\-c <pattern> [<command string>]
+Pattern which clears the event counter. Executes optionally a command if an event command has been executed before.
+.TP
+\-p
+Writes data also to stdout (for piped logging).
+.TP
+\-u <name>
+Become another user, e.g. www\-data.
+.TP
+<command string>
+Defines the event command string where $0\-$9 are substituted by the submatches of the regular expression.
+.SH 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\\'"
+
+.SH SEE ALSO
+qsdt(1), qsfilter2(1), qsgeo(1), qsgrep(1), qshead(1), qslog(1), qslogger(1), qspng(1), qsre(1), qsrespeed(1), qsrotate(1), qssign(1), qstail(1)
+.SH AUTHOR
+Pascal Buchbinder, http://mod-qos.sourceforge.net/