QSGREP(1) qsgrep man page QSGREP(1)NAME
qsgrep - Print 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=([0-9.]*)' -o 'ip=$1' error_log
SEE ALSO qsexec(1), qsfilter2(1), qsgeo(1), qslog(1), qslogger(1), qspng(1), qsrotate(1), qssign(1), qstail(1)AUTHOR
Pascal Buchbinder, http://opensource.adnovum.ch/mod_qos/
mod_qos utilities 10.8 June 2012 QSGREP(1)
Check Out this Related Man Page
QSPNG(1) qspng man page QSPNG(1)NAME
qspng - Utility to draw a png graph from qslog(1) output data.
SYNOPSIS
qspng -i <stat_log_file> -p <parameter> -o <out_file> [-10]
DESCRIPTION
qspng is a tool to generate png (portable network graphics) raster images files from semicolon separated data generated by the qslog util-
ity. It reads up to the first 1440 entries (24 hours) and prints a graph using the values defined by the 'parameter' name.
OPTIONS -i <stats_log_file>
Input file to read data from.
-p <parameter>
Parameter name, e.g. r/s or usr.
-o <out_file>
Output file name, e.g. stat.png.
SEE ALSO qsexec(1), qsfilter2(1), qsgeo(1), qsgrep(1), qslogger(1), qslog(1), qsrotate(1), qssign(1), qstail(1)AUTHOR
Pascal Buchbinder, http://opensource.adnovum.ch/mod_qos/
mod_qos utilities 10.8 June 2012 QSPNG(1)
Hi Friends,
well what i want to do is that suppose i have a file say like
....
ronaldduckdancecoolman
donaldmuckdancepooltactics
fonaldguckdancetoolbutcomps
....
okok i agree this is a ridiculous data for a file.
:-)
now i want that the characters in each line fromposition 16 to say 19... (6 Replies)
how do i check a file for a pattern and perform an action if it doesn't exist?
i know how to search a file for a pattern. you just place it in an array like so.
#!/usr/bin/perl
my $data_file = "file.txt";
open DATA, "$data_file";
my @array_of_data = <DATA>;
if ($_ =~ m/pattern/i) {... (4 Replies)
Hi
I'm not very good with the serach patterns and I'd need a sample how to find a line that has multiple patterns.
Say I want to find a line that has "abd", "123" and "QWERTY" and there can be any characters or numbers between the serach patterns, I have a file that has thousands of lines and... (10 Replies)
Gurus,
If is my file
<PRODUCT_TYPE>DN</PRODUCT_TYPE><SERVER_NAME>testserver1</SERVER_NAME><FLAVOR>Windows</FLAVOR><OS>Windows NT</OS><CPU>4</CPU>
<PRODUCT_TYPE>PN</PRODUCT_TYPE><SERVER_NAME>testserver2</SERVER_NAME><FLAVOR>Windows</FLAVOR><OS>Windows NT</OS><CPU>3</CPU>
... (6 Replies)
I have the following situation:
a text file with 50000 string patterns:
abc2344536
gvk6575556
klo6575556
....
and 3 text files each with more than 1 million lines:
...
000000 abc2344536 46575 0000
000000 abc2344536 46575 4444
000000 abc2344555 46575 1234
...
I... (8 Replies)
Hello all,
I have many files in a directory and I'm trying to read each file in the directory, search for four patterns and return the name of the file only if it contains each of the 4 patterns. I'm familiar with using egrep -l "(pattern1|pattern2)" *, but it seems like doing something similar... (4 Replies)
hi all,
I am trying to do search on a gzip file. The file has
<pattern1>
Data..
<pattern2>
data
<pattern1>
data
<patter2>
I want to print each pattern 1 and the corrresponding pattern2. If pattern 2 fails to appear and pattern 1 appears, I do not want to print pattern1 and... (3 Replies)
Hi All,
I have a file in which i have to search for a pattern from the beginning of the file and if the pattern is found , then i have to perform a reverse search from that line to the beginning of the file to get the first occurrence of another pattern.
sample input file
hey
what are you... (8 Replies)
Hi everyone,
I am trying to retrieve certain log from a big file. The log size can be from 200 - 600 lines. I have 3 search patterns, out of which 2 (first and last lines) search patterns are common for all the transactions but 3rd search pattern (occurs in the middle of transaction) is... (5 Replies)
Hi All,
I have to search for patterns from a pattern file in a file and mark the matching lines.
Input File:
Student1 60 30
Student2 71 91
Student3 88 98
Pattern file:
Student1 Fail
Student2 Pass
Student2 Pass
Desired output:
Student1 60 30 Fail
Student2 71 91 Pass (5 Replies)
Hi,
I tried to search multiple pattern using awk
trans=1234
reason=LN MISMATCH
rec=`awk '/$trans/ && /'"$reason"'/' file`
whenevr i tried to run on command promt it is executing but when i tried to implment same logic in shell script,it is failing i.e $rec is empty
... (6 Replies)
I am trying to search the pattern "ARS (11)" and after the LAST pattern, i am trying to open new line and enter text using sed.
My Existing Text file is Users.txtpaul, Paul Smith, Stevn Smiley, REQ000001, ARS (11)
sam, Sam Martin, Stevn Smiley, REQ000001, ARS (11)
mike, Mike Conway, Stevn... (8 Replies)
Hi,
I need help to find patterns that are common or matched in a specified column in multiple files.
File1.txt
ID1 555
ID23 8857
ID4 4454
ID05 555
File2.txt
ID74 4454
ID96 555
ID322 4454 (4 Replies)
Hi,
I want to know which pattern matching technique will be giving better performance and quick result.
I will be having the patterns in a file and want to read that patterns and search through a whole file of say 70 MB size. whether if i initially create a pattern matching string while... (7 Replies)