Sponsored Content
Top Forums Shell Programming and Scripting Grep with multiple instances of same pattern Post 302348975 by protocomm on Sunday 30th of August 2009 03:39:01 PM
Old 08-30-2009
With awk ...perhaps a solution...

cat file | awk -F "Received" '{print $1,"Received"}'
 

10 More Discussions You Might Find Interesting

1. Solaris

Multiple pattern on same line using grep

Hi, I would like to search multiple patterns on same line, i.e. all patterns must present on same line. Please suggest. Thanx (2 Replies)
Discussion started by: sanjay1979
2 Replies

2. Shell Programming and Scripting

Grep with multiple instances of same pattern

Hi, This is my text file I'm trying to Grep. Apple Location Greenland Rdsds dsds fdfd ddsads http Received Return Immediately Received End My Grep command: grep only--matching 'Location.*Received' e. Because the keyword Received appears twice, the Grep command will stop at the last... (0 Replies)
Discussion started by: spywarebox
0 Replies

3. Shell Programming and Scripting

How to grep multiple pattern from XML file

Hi Everyone pls if anyone can help me in writing a script or correcting it what I have done. I want to write a script to grep record number for all those record which have abc xyd cat dog in one of the field say VALUE, I have thousand of file in a dir and I want to search every file for... (6 Replies)
Discussion started by: revertback
6 Replies

4. Shell Programming and Scripting

Grep command with multiple pattern

Hi, I want to search multiple patterns in a variable. DB_ERR=`echo "$DB_TRANS" | grep "SP2-" | grep "ORA-"` echo $DB_ERR But I am not getting anything in DB_ERR. I want to print each line on seperate line. Could you please help me out in this. Thanks in advance. (14 Replies)
Discussion started by: Poonamol
14 Replies

5. Programming

Control multiple program instances - open multiple files problem

Hello. This shouldn't be an unusual problem, but I cannot find anything about it at google or at other search machine. So, I've made an application using C++ and QtCreator. I 've made a new mime type for application's project files. My system (ubuntu 10.10), when I right click a file and I... (3 Replies)
Discussion started by: hakermania
3 Replies

6. Shell Programming and Scripting

Grep multiple instances and send email.

Removed (15 Replies)
Discussion started by: saisneha
15 Replies

7. Shell Programming and Scripting

Grep text between multiple pattern

Hello everybody, I have been looking around but can't figure how to do a grep command, that find the text between multiple patterns, example: (pattern1 OR pattern2) AND (pattern3 OR pattern4) text that I want (pattern5 OR pattern6) AND (pattern7 OR pattern8) So how do I find the "text... (4 Replies)
Discussion started by: Benou
4 Replies

8. Linux

Creating 2 variables from a multiple pattern grep

first time poster here Im pretty new to grep and linux in general and I spent pretty much all day yesterday researching and coming up with a grep command to help with my university project. I am attempting to create a proof of concept bash script to scan the network using ngrep, find appropriate... (7 Replies)
Discussion started by: scottish_jason
7 Replies

9. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies

10. Shell Programming and Scripting

Grep multiple pattern

I have got a text from each line, I need to fetch port only if there is an ip a.text text and port=25 b.ip=(12.32.54.256) and port="52" c.ip=(55.251.253.12) and port=25" d.text text and port="5" e.ip=(45.211.155.15) and port="457" f.ip=(144.158.256.2) and port="588" I know how to... (6 Replies)
Discussion started by: arpagon
6 Replies
named.stats(4)						     Kernel Interfaces Manual						    named.stats(4)

NAME
named.stats - Contains BIND server statistics DESCRIPTION
The named.stats file contains server statistics for queries to and from hosts in a BIND environment. You can use this data to determine the load on a DNS server and diagnose problems. See the named(8) reference page for information about how to specify the name and location of the named.stats file; the default is /var/tmp/named.stats. The query fields for global and per-node statistics, as specified in the LEGEND section of the named.stats file, are defined as follows: Received a response from a node Received a negative response from a node Received a response from a node that this node had to forward Received an extra answer from a node Received a server failed message (SERVFAIL) from a node Received a format error message (FORMERR) from a node Received some other error from a node Received an zone transfer request mes- sage (AXFR) from a node Received a lame delegation from a node Received some IP options from a node Sent a node a system query Sent a node an answer Forwarded a query to a node Sent a node a retry Sent to a node, but the send failed (in sendto) Received a query from a node Received an inverse query from a node Received a query from a node that this node had to forward Received a retry from a node Received a query using TCP from a node Forwarded a response to a node Sent a node a server failed message (SERVFAIL) Sent a node a format error message (FORMERR) Sent a non-authoritative answer to a node Sent a negative response to a node EXAMPLES
The following example is an excerpt of a named.stats file: +++ Statistics Dump +++ (917839766) Sun Jan 31 22:29:26 1999 370508 time since boot (secs) 370508 time since reset (secs) 130 Unknown query types 711033 A queries 35 NS queries 37 CNAME queries 40 SOA queries 2 MB queries 198963 PTR queries 26088 MX queries 1 TXT queries 20 AAAA queries 60910 ANY queries ++ Name Server Statistics ++ (Legend) RR RNXD RFwdR RDupR RFail RFErr RErr RAXFR RLame ROpts SSysQ SAns SFwdQ SDupQ SErr RQ RIQ RFwdQ RDupQ RTCP SFwdR SFail SFErr SNaAns SNXD (Global) 537 231 479 0 2 10 0 0 5 0 54 56382 479 8 2 38849 3 0 0 6 479 2 5 19057 1285 [0.0.0.0] 0 0 2 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 23 1 0 0 0 [4.0.38.18] 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 [4.0.147.94] 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 . . . The values in each entry below the (Global) delimeter are separated into five groups, each with five numbers. These groups of numbers cor- relate to the fields in the Legend section of the file, which are separated into similar groups. From the left of an entry, the first field is RR, the next is RNXD, and so on. In the next group of five on the same line, the first field is RFErr, the next is RErr, and so on. In the Global entry, you can see that, in total, there were 537 queries received, 231 negatives responses received, 479 queries that were forwarded to other BIND servers, and so on. Subsequent entries can be interpreted in a similar manner. The Global values in this example are indicative of several problems: RFail = 2 The server received 2 failure messages from a node or nodes. There might be a problem with the nodes that attempted to query the server. Find the IP addresses of the nodes and contact the administrators. RFErr = 10 The server received 10 improperly formatted queries from a node or nodes. If this happens consistently, a hacker might be trying to break into the server. You should run a monitoring tool to collect more data. RLame = 5 The server received 5 lame delegations. This problem occurs if nodes query the server for information regarding a zone for which it has no authority. It is usually a temporary condition, but if the problem persists, contact the nodes' administrators and ask them to check their configurations. RDupR = 8 A node or nodes sent multiple copies of the same query to the server. These errors are usually benign, but nodes should give up after 3 attempts. If the number of duplicates is fairly high, there might be a problem with the nodes or the network. SErr = 2 The server attempted to send 2 queries to a forwarder or forwarders by using the sendto system call, and the attempts failed. Check your configuration and make sure that all of the forwarders you listed are reachable. RIQ = 3 The server received 3 inverse queries. These queries are usually benign, but if the value is fairly high, a hacker might be trying to break into the server. You should run a monitoring tool to collect more data. SFail = 2 The server sent 2 failure messages to a node or nodes. These failures are usually benign, but might not be under certain condi- tions. If the server sends many SFail errors to one node, there might be a problem with that node. If the node is another name- server, it might be lame nameserver. If the node is a host, it is sending abnormal queries. You should find the offending node and resolve the problem. SFerr = 5 The server informed a node or nodes that their requests were improperly formatted. The value of this field usually correlates to the RFErr field. You should find the offending node and resolve the problem. FILES
The syslogd daemon offers a partial listing of the named.stats data in the daemon.log file. RELATED INFORMATION
Commands: named(8), syslogd(8) delim off named.stats(4)
All times are GMT -4. The time now is 02:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy