Sponsored Content
Top Forums Shell Programming and Scripting select a line that contains the strings Post 302246555 by Bijayant Kumar on Tuesday 14th of October 2008 01:00:12 AM
Old 10-14-2008
bijayant@bijayant ~ $ cat test
hi this is bijayant 17
Received message 17
17 Received message
18 Received message
19 Received message
Bijayant Received message
Bijayant 17 Received message
17 Received message

bijayant@bijayant ~ $ grep -i "17.Received message\|Received message.17" test
Received message 17
17 Received message
Bijayant 17 Received message
17 Received message
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to select strings with space?

Hi folks, I have the following select function: select_vs_plugin() { export VS_LIST=`cat VsList.lst` while ] do echo echo echo =================================================================== ============ echo Please select Video Server Plugin ... (4 Replies)
Discussion started by: nir_s
4 Replies

2. Shell Programming and Scripting

awk to select a column from particular line number

The awk command awk -F: '{print $1}' test1 gives the first columns of all the lines in file ,is there some command to get a particular column from particular line . Any help is appreciated. thanks arif (4 Replies)
Discussion started by: mab_arif16
4 Replies

3. UNIX for Dummies Questions & Answers

How to select line by line in shell

Hi, This is what the file data.lst contains. aaaaaaaa eeeeeeeeeeeeeeee 4444444 rrrrrrrrrrrrr tttttttttttt bbbbbbbb eeeeeeeeeeeeeeee 7777777 uuuuuuuu eeeeeeeee qqqqqqqq gggggggggggggggg 6666666 oooooooo ppppppppp Here I want to cut the third field and put it in a new file ... (15 Replies)
Discussion started by: preethgideon
15 Replies

4. Shell Programming and Scripting

awk program to select a portion of a line

Hi all, I am new to awk programs.I have a file like this vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd... (3 Replies)
Discussion started by: anju
3 Replies

5. Shell Programming and Scripting

How to Select or cut from the certain filed to the end of the line

Hi: I have few rows in file..Like suppose... 9063C0 44 00051363603253033253347 3333 070248 06 9063C0 5G PAN00013 9063C0 44 00061030305040404250724 0506 100248 08 9063C0 43 01 00000089 I need to cut the row starting after... (5 Replies)
Discussion started by: grajesh_955
5 Replies

6. Shell Programming and Scripting

select entry from consecutive line awk

Hi folks, I have a file with four columns that looks like the following (tab separated) 1 1 1 a 2 2 2 b 3 3 3 c 4 4 4 d I would like to create a file with always 4 columns but where the third entry corresponds to the thirst entry of the next line and so on, to get the following 1 1 2 a... (4 Replies)
Discussion started by: klebsiella
4 Replies

7. Shell Programming and Scripting

Select only the last line from the pattern

Hi, I am really new in the shell script, but it is really useful for me to learn. I have one question, I have a large text document (actually few of them), inside there are lines with information about energies, between 10 to 20 of this lines, varies from one doc to another one, my questions... (11 Replies)
Discussion started by: hmartine1983
11 Replies

8. Shell Programming and Scripting

PS3 and SELECT, is it possible to put a line break?

Hi all, Before I give up on using SELECT for my first attempt at creating a menu driven script, can anyone please advise if it is possible to include a line break for PS3, I've tried putting in a \n and it does not work. Tried for both bash and ksh and both gives the same result. Preference... (3 Replies)
Discussion started by: newbie_01
3 Replies

9. Shell Programming and Scripting

Select only line numbers using grep

Hai, I want to select only line numbers into a file if some pattern matches. I have written my script like below but its not working. #!/bin/sh file='/home/testfile1' filesearch='/home/test00' while read line do search=`echo $line |cut -c 1-24` echo $search echo `grep -n ""... (3 Replies)
Discussion started by: Subbu123
3 Replies

10. UNIX for Beginners Questions & Answers

Use strings from nth field from one file to match strings in entire line in another file, awk

I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file. I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 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 07:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy