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

# qsgrep(1)

prints matching patterns within a file.

## NAME

qsgrep - prints matching patterns within a file.

## SYNOPSIS

qsgrep -e \<pattern\> -o \<sub string\> \[\<path\>\]

## DESCRIPTION

qsgrep is a simple tool to search patterns within files. It uses regular expressions to find patterns and prints the submatches within a pre-defined format string.

## OPTIONS

- \-e \<pattern\>

  Specifes the search pattern.

- \-o \<string\>

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

- \<path\>

  Defines the input file to process. qsgrep reads from from standard input if this parameter is omitted.

## EXAMPLE

Shows the IP addresses of clients causing mod\_qos(031) messages):

  qsgrep -e 'mod\_qos\\(031\\).\*, c=(\[a-zA-Z0-9:.\]\*)' -o 'ip=$1' error\_log

## SEE ALSO

qsdt(1), [qsexec(1)](/qsexec/1.md), [qsfilter2(1)](/qsfilter2/1.md), [qsgeo(1)](/qsgeo/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/
