10-16-2012
Shell script to search a keyword in six different servers
Hello,
I need a shell script which takes search keyword as input and then searches logs in six different servers and provide me the logs where in it found the keyword.
Can anyone help????
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi guys i have a problem here, im trying to stablish a relationship between a text file and an input user for example the script is going to prompt the user for some football team and what the script is going to do is return the colums in which that input is located so far this is what i have ... (6 Replies)
Discussion started by: lucho_1
6 Replies
2. Shell Programming and Scripting
Hi,
I have a question with sed/awk. When I handle some log files I want to search all reports with specified keyword. For example, in the log below.
abcd
efg
===start
abc
e
===end
xyz
===start
af
f
===end
nf
ga
===start
ab
===end (4 Replies)
Discussion started by: danielnpu
4 Replies
3. Shell Programming and Scripting
Dear All,
I have a file containing info like
TID:0903 asdfasldjflsdjf
TID:0945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
TID:1945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
I need to show only lines containing
TID:0903 asdfasldjflsdjf
TID:0945 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
TID:2045 hjhjhkhkhkh
... (11 Replies)
Discussion started by: saifurshaon
11 Replies
4. Shell Programming and Scripting
Hello all, I know that is a question which has made too many times, and I have been looking into the threads but all posted was not sucessfully for me so...
I need a shell script which connect two unix servers, but NOT using ssh... Is there another way to do it?
I've tried ssh but it didn't... (1 Reply)
Discussion started by: Geller
1 Replies
5. Shell Programming and Scripting
I have my data something like this
I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword.
In other words, if a keywords is found in two subsequent lines delete the second line.
input data:
aaaa bbbbb cccc dddd
xxxx... (4 Replies)
Discussion started by: rdhanek
4 Replies
6. Shell Programming and Scripting
You have two files to compare by searching keyword from one file into another file
File A
23 >pp_ANSWER
24 >aa hello
25 >jau head wear
66 >jss oops
872 >aqq olps ploww oww sss
722 >GG_KILLER
..... large files
File B
Beta done
KILLER
John Mayor
calix meyers
... (5 Replies)
Discussion started by: cdfd123
5 Replies
7. Solaris
Hi,
I have a file which got only one column and got some keywords. I have another file where the keywords used in the first file are repeated in the second file.
Now I would like to know how many times each keyword from the first file is repeated in the second file.
Request your help on... (1 Reply)
Discussion started by: pointers
1 Replies
8. Shell Programming and Scripting
What is the best way (bash/awk/sed?) to read in two text files and do a keyword search/replace?
file1.txt:
San Francisco
Los Angeles
Seattle
Dallas
file2.txt:
I love Los Angeles.
Coming to Dallas was the right choice.
San Francisco is fun.
Go to Seattle in the summer.
... (3 Replies)
Discussion started by: pxalpine
3 Replies
9. Shell Programming and Scripting
Hi
I want to implement something like this:
if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add New_Keyword at the end of line
end if
eg:
Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies
10. Shell Programming and Scripting
Hi ,
I have written a small script :
set -x
#!/bin/ksh
for i in `cat /tmp/list` ( list contains remove servers )
do
ssh -t $i << EOF
uname -a
cd ~user
echo "Enter the dir >"
read dir
path=`ll -ld /home/user/"$dir"`
if ; then
echo "Dir exists "
read
rm $path
else
echo "no such... (9 Replies)
Discussion started by: kpatel786
9 Replies
LEARN ABOUT OSF1
resolver
resolver(4) Kernel Interfaces Manual resolver(4)
NAME
resolver - resolver configuration file
SYNOPSIS
/etc/resolv.conf
DESCRIPTION
The resolver is a set of routines in the C library that provide access to the Internet Domain Name System. The resolver configuration file
(resolv.conf) contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed
to be read by humans and contains a list of keywords with values that provide various types of resolver information.
The different configuration options are: Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS
(currently 3) name servers may be listed, one per keyword. If there are multiple servers, the resolver library queries them in the order
listed. If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a
name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum
number of retries are made). Local domain name. Most queries for names within this domain can use short names relative to the local
domain. If no domain entry is present, the domain is determined from the local host name returned by gethostname(); the domain part is
taken to be everything after the first dot (.). Finally, if the host name does not contain a domain part, the root domain is assumed.
Search list for host name lookup. By default, the search list consists of the local domain name. You can change this system wide by speci-
fying search keyword followed by a list of domain names separated by spaces or tabs, or on a per-process basis by specifying the LOCALDO-
MAIN environment variable followed by a list of domain names separated by spaces or tabs.
Most resolver queries will be attempted using each component of the search path in turn until a match is found. This process might
be slow and generate a lot of network traffic, if the servers for the listed domains are not local, and that queries will time out
if no server is available for one of the domains.
The search list is currently limited to six domains with a total of 256 characters. Enables the sorting of addresses returned by
gethostname. A sortlist comprises pairs of IP addresses and optional netmasks; each IP address and optional netmask are separated
by a slash character (/). The netmask is optional, and defaults to the current network netmask. You can specify up to 10 pairs.
For example: sortlist 130.155.160.0/255.255.240.0 130.155.0.0 Option for host name lookup. By default, when a host name contains
one or more dots (.), resolver looks up the name as given before applying the search list. The n specifies the minimum number of
dots a name must contain in order to be looked up as given before applying the search list. The range is from 0 to 15.
You can change the resolver options system wide by specifying options keyword followed a list of resolver options separated by spa-
ces, or on a per-process basis by specifying the RES_OPTIONS environment variable followed by a list of resolver options separated
by spaces.
The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance will
override.
The keyword and value must appear on a single line, and the keyword (for example, nameserver) must start the line. The value follows the
keyword, separated by white space.
FILES
/etc/resolv.conf
RELATED INFORMATION
Functions: dn_comp(3), dn_expand(3), gethostbyname(3), res_init(3), res_mkquery(3), res_query(3), res_search(3), res_send(3).
Files: hostname(5).
Commands: named(8). delim off
resolver(4)