Re: What is the preferred way to parse messages out of a log?
- From: "William Brogden" <wbrogden@xxxxxxx>
- Date: Mon, 18 Sep 2006 11:44:17 -0500
On Sun, 17 Sep 2006 16:54:41 -0500, <SuperGh0d@xxxxxxxxx> wrote:
Thanks for the replies. I need to extract the values of the message and
I was hoping to create objects from them and stuff the objects into an
arraylist so I can iterate through them. Eventually the idea is to
build a servlet that will format the messages in a easier to read
format, provide searching and message grouping by the dialogID. I have
played with perl and I feel the use of Java objects is easier for me to
understand than using perl's hashes. Obviously you feel perl is the way
to go,
Not me - I never can keep Perl operators straight.
can you provide me a basic example of how you would store thedata in a structure so I can retrieve them later?
http://servingxml.sourceforge.net/examples/index.html
has several worked out examples of flat file to XML document that
might inspire you. Once you have a DOM, you could use XPath as provided
in Java 1.5 (javax.xml.xpath package) to selectively extract values.
(a quick survey of xpath use)
http://searchwebservices.techtarget.com/tip/1,289483,sid26_gci1166338,00..html
William Brogden wrote:.On Sat, 16 Sep 2006 20:43:30 -0500, <paulers69@xxxxxxxxx> wrote:
> Hello,
>
> I have a large log file that contains information that I wish to pull
> out.. The log entry consists of multiple lines per message Can someone
> point me in the right direction to extracting this data? Below is an
> example of an entry that I would like to parse the values out of. Your
> help is greatly appreciated.
>
> 11:44:29 pg100B-pim1 Trace: [ 2516]VRU->PG: Service Control Message (=
> Message Type 47); Message Length 713 bytes
> New Call (= Subtype 5); DialogueID: (74521) 00012319;
> SendSeqNo: (1)00000001
> Trunk Group ID: (1) 00000001
> Trunk Number: 2
> Service ID: (1) 00000001
> Dialed Number: JP_TMZ_CARD_FDS
> ANI: 5125379013
> Called Number: 8889648542
> DNIS: 8889648542
> Call Variable 1:
> Call Variable 2: FDS
> Call Variable 3:
> Call Variable 4:
> Call Variable 5:
> Call Variable 6:
> Call Variable 7:
> Call Variable 8:
> Call Variable 9: 5125379013 ,00
> Call Variable 10:
> ECCVar:3: "dd849f24-270d-11db-469c-00e081022fd9
> 8889649541
> 3
> "
>
If you are comfortable with Java tools for XML you might look into
this "pipeline" oriented toolkit:
http://servingxml.sourceforge.net/
The site contains examples of working with various "flat" file formats
and interconverting to and from XML.
Bill
- References:
- What is the preferred way to parse messages out of a log?
- From: paulers69
- Re: What is the preferred way to parse messages out of a log?
- From: William Brogden
- Re: What is the preferred way to parse messages out of a log?
- From: SuperGh0d
- What is the preferred way to parse messages out of a log?
- Prev by Date: Re: Newbie question on identifiers for basic catch statements
- Next by Date: Re: Mac driving me crazy
- Previous by thread: Re: What is the preferred way to parse messages out of a log?
- Next by thread: Re: What is the preferred way to parse messages out of a log?
- Index(es):
Relevant Pages
|