Program to parse logs...?

This is the place to leave ure message
Unreal related
User avatar
Xavious
Posts: 2250
https://www.facebook.com/warszawa.kuchnie.na.wymiar/
Joined: Sun Jul 13, 2003 7:01 pm

Program to parse logs...?

Post by Xavious »

So i've recorded a log of an in-game meeting in Unreal (Well it was WoW but WoW isn't unreal-related) but it's full of other bumph also... www.edgeways.wowgr.net/filedump/log.txt for an example of what i mean...

Anyone know a program i can use to automatically take out those lines containing [8.hcraids] and [7.edgeways]?

Hehe big problem with WoW is the technical-minded folk are few and far between...

Thanks.
User avatar
}TCP{Cee
Posts: 4233
Joined: Fri Dec 20, 2002 6:01 pm
Location: Germany

Post by }TCP{Cee »

Guess not :P
Then dunno :P
the_kay
Posts: 1023
Joined: Thu May 25, 2006 6:24 pm

Post by the_kay »

hm...
you could write a small shell script...
something like that...if you are running a unix-like machine...

Code: Select all

cat log.txt | egrep KLHTM > log2.txt
comm -23 log.txt log2.txt > finallog.txt
cat finnallog.txt
(btw: this code doesn't really work and I don't have an idea, why not. log2.txt does not seem to be the problem, comm doesn't seem to do what I want...tell me if you know the bug)
User avatar
Xavious
Posts: 2250
Joined: Sun Jul 13, 2003 7:01 pm

Post by Xavious »

Hehehe i downloaded lots of programs and visited lots of sites that told me similar things but i'm afraid it's all above my skill...

I'm sure somebody somewhere has made a simple program for these kind of things...
User avatar
}TCP{Wolf
Site Admin
Posts: 4663
Joined: Thu Dec 19, 2002 7:30 pm
Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
Contact:

Post by }TCP{Wolf »

EMAIL ME!
-=]I AM GETTING TOO OLD FOR SUBTLETY[=-

mail: chaos.worx[at]gmx.net
IRC Quakenet +OTR: }TCP{Wolf @#oldunreal @#tcp.clan
Jabber/XMPP +OTR: Wolfy359@jabber.org
Threema: CR6Y9YSS
Signal: see profile
ICQ: dead since russian takeover disables OTR
User avatar
Xavious
Posts: 2250
Joined: Sun Jul 13, 2003 7:01 pm

Post by Xavious »

Email you what? The contents of the first post?
User avatar
}TCP{Wolf
Site Admin
Posts: 4663
Joined: Thu Dec 19, 2002 7:30 pm
Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
Contact:

Post by }TCP{Wolf »

Yup...
-=]I AM GETTING TOO OLD FOR SUBTLETY[=-

mail: chaos.worx[at]gmx.net
IRC Quakenet +OTR: }TCP{Wolf @#oldunreal @#tcp.clan
Jabber/XMPP +OTR: Wolfy359@jabber.org
Threema: CR6Y9YSS
Signal: see profile
ICQ: dead since russian takeover disables OTR
User avatar
}TCP{Wolf
Site Admin
Posts: 4663
Joined: Thu Dec 19, 2002 7:30 pm
Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
Contact:

Post by }TCP{Wolf »

never mind... you got mail...
-=]I AM GETTING TOO OLD FOR SUBTLETY[=-

mail: chaos.worx[at]gmx.net
IRC Quakenet +OTR: }TCP{Wolf @#oldunreal @#tcp.clan
Jabber/XMPP +OTR: Wolfy359@jabber.org
Threema: CR6Y9YSS
Signal: see profile
ICQ: dead since russian takeover disables OTR
User avatar
}TCP{aLICe
Posts: 1110
Joined: Thu Mar 20, 2003 5:23 pm

Post by }TCP{aLICe »

ehhhhhhhh.... to late :P

BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:

Code: Select all

grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]
Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name file 8)
User avatar
}TCP{ZzCaT
Posts: 1348
Joined: Fri Dec 20, 2002 8:56 pm
Location: Tukker Country

Post by }TCP{ZzCaT »

}TCP{aLICe wrote:ehhhhhhhh.... to late :P

BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:

Code: Select all

grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]
Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name file 8)
Linux is for nerds.
ZZ
the_kay
Posts: 1023
Joined: Thu May 25, 2006 6:24 pm

Post by the_kay »

}TCP{aLICe wrote:ehhhhhhhh.... to late :P

BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:

Code: Select all

grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]
Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name file 8)
Well that's what I got, too.
But the question was:
Anyone know a program i can use to automatically take out those lines containing [8.hcraids] and [7.edgeways]?
The filtered_log_file_name file contains only those lines with 8.hcraids and 7.edgeways.
The opposite is needed, not 8.hcraids-lines are needed but those without 8.hcraids.

That's why I compared the orginal log.txt (contains lines with and without strings like 8.hcraids) with the log2.txt (contains only strings with 8.hcraids).

Code: Select all

comm -23 log.txt log2.txt
comm should normally compare two files (in this case log.txt and log2.txt) and print:
1. all lines that are log.txt but not in log2.txt
2. all lines that are log2.txt but not in log.txt
3. all lines that are in both files the same.

Only point 1 is needed, therefor I remove others with the option -23

I have no idea why it is not working...

}TCP{ZzCaT wrote:Linux is for nerds.
GNU/Linux is for both nerds and non_nerds (although nerds get more adventages) ;)
the_kay
Posts: 1023
Joined: Thu May 25, 2006 6:24 pm

Post by the_kay »

well on IRC I got another code that workes just fine:

Code: Select all

cat file | perl -e 'while(<>) { /unwantedstring/ || print; } ' > outfile
So you can send me the file, too, if you don't have a unix-like machine and do it yourself.
User avatar
Xavious
Posts: 2250
Joined: Sun Jul 13, 2003 7:01 pm

Post by Xavious »

Hehe well Wolf helped me out over email, so it's sorted now. I guess there's many ways to parse a log file like that, i just couldn't get my head around any of them...

Thanks Wolf and all! You is my heroes!
User avatar
}TCP{aLICe
Posts: 1110
Joined: Thu Mar 20, 2003 5:23 pm

Post by }TCP{aLICe »

Code: Select all

grep -v 'unwantedstring' > outfile
the_kay
Posts: 1023
Joined: Thu May 25, 2006 6:24 pm

Post by the_kay »

}TCP{aLICe wrote:

Code: Select all

grep -v 'unwantedstring' > outfile
nice 8)
Sometimes it's easier to read a manpage then to write a script....:P
Post Reply