|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Shell script help
Here is 3 sample lines from a log file
<date> INFO <java.com.blah> abcd:ID= user login <date> DEBUG <java.com.blah> <nlah bla> abcd:ID=123 user login <date> INFO <java.com.blah> abcd:ID=3243 user login I want to find unique "ID" from this log file. Problem is that it is not in the same delimiter field and also as null someimte "ID=" without any value which I like to ignore . Any pointers or even possible with simple grep/awk command if not script? |
|
#2
|
||||
|
||||
|
It would me "better" if you post the EXACT format of the data in order to suggest a solution.
![]()
__________________
|
|
#3
|
|||
|
|||
|
Code:
sed -n '/:ID=[0-9]/ s/.*ID=\(.*\) user.*/\1/p' logfile | sort -u |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Shell script help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|