Anda di halaman 1dari 1

Extracting IPs From Oracle Listener Log

There may be times when you want to extract all the client and host IPs from the listener log to
see whos connecting to a particular database or service.

I was interested in a particular service so the following will extract all IPs connecting in to that
service. Please not that our listener logs are rotated and zipped.

$
zgrep <SERVICE_NAME> *.zip
1 10.30.37.199
1 10.20.67.111

$
1
zgrep <SERVICE_NAME> *.zip | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\
2
{1,3\}' | sort | uniq -c | sort -n
3
1 10.30.37.199
4
1 10.20.67.111
5
3 10.30.66.154
6
3 10.30.76.38
7
3 10.20.117.171
8
4 10.20.112.58
9
10 10.20.203.9
10
16 10.20.112.112
11
18 10.20.117.186
12
30 10.20.193.17
13
32 10.30.35.91
14
39 10.20.193.18
15
44 10.20.112.23
16
48 10.20.193.15
17
53 10.20.193.16
18
70 10.20.112.6
19
74 10.20.107.143
20
100 10.40.32.23
21
101 10.20.203.8
22
703 10.20.193.13
23
989 10.20.193.78
24
995 10.20.193.79
25
14101 10.20.203.155

You could tweak it and pipe it to nslookup to get actual hostname but for my requirements the
above was enough.

Anda mungkin juga menyukai