# phpman > man > qsexec(1)

[QSEXEC(1)](https://www.chedong.com/phpMan.php/man/QSEXEC/1/markdown)                                  qsexec man page                                 [QSEXEC(1)](https://www.chedong.com/phpMan.php/man/QSEXEC/1/markdown)



## 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 de‐
       fined 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 ex‐
              ecution.

       -c <pattern> [<command string>]
              Pattern which clears the event counter. Executes optionally a command if an event com‐
              mand 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)](https://www.chedong.com/phpMan.php/man/modqos/031/markdown)
       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/lo‐
       cal/bin/deny.sh $1\'"


## SEE ALSO
       [qsdt(1)](https://www.chedong.com/phpMan.php/man/qsdt/1/markdown), [qsfilter2(1)](https://www.chedong.com/phpMan.php/man/qsfilter2/1/markdown),  [qsgeo(1)](https://www.chedong.com/phpMan.php/man/qsgeo/1/markdown),  [qsgrep(1)](https://www.chedong.com/phpMan.php/man/qsgrep/1/markdown),  [qshead(1)](https://www.chedong.com/phpMan.php/man/qshead/1/markdown),  [qslog(1)](https://www.chedong.com/phpMan.php/man/qslog/1/markdown),  [qslogger(1)](https://www.chedong.com/phpMan.php/man/qslogger/1/markdown),  [qspng(1)](https://www.chedong.com/phpMan.php/man/qspng/1/markdown),
       [qsre(1)](https://www.chedong.com/phpMan.php/man/qsre/1/markdown), [qsrespeed(1)](https://www.chedong.com/phpMan.php/man/qsrespeed/1/markdown), [qsrotate(1)](https://www.chedong.com/phpMan.php/man/qsrotate/1/markdown), [qssign(1)](https://www.chedong.com/phpMan.php/man/qssign/1/markdown), [qstail(1)](https://www.chedong.com/phpMan.php/man/qstail/1/markdown)

## AUTHOR
       Pascal Buchbinder, <http://mod-qos.sourceforge.net/>



mod_qos utilities 11.63                       May 2019                                     [QSEXEC(1)](https://www.chedong.com/phpMan.php/man/QSEXEC/1/markdown)
