New to vb.net. We are a little behind and use Visual Studio 2005 where I work. I have a file called auditserver.log that I have to read in and pull data from for a security program so they can tell who has logged into the system. I think I can use the built in xml reader function except I am not sure it will work because the the auditlog has a .log extension instead of a .xml extension and because within the document there are characters in front of the first xml tag. For example:
20130628:123617.916:<?xml version="1.0" encoding="UTF-8"?><AuditMessage xmlns:xsi="http://www.someurlhere.com" xsi:noNamespaceSchemaLocation="http://infosolutions.someplace.com/audit/XYZauditmessagepayload.xsd"><EventIdentification EventActionCode="R" EventDateTime="20130628123209" EventID="100_ModuleAccess" EventOutcomeIndicator="0"></EventIdentification><UserIdentification RoleID="some role" UserID="abcdef">
The file has multiple entries like this and I am only submitting a portion because a lot of it contains protected information. Before I start any coding, my question is, would it be easier to remove the digits preceding the xml code and use the built in xml parser (if that is even possible) or should I just somehow use the <> as delimiters or is there an even better way that I am not aware exists.
If I left out necessary information, I am sorry. I am just starting in the field and I know I have a lot to learn. I know typically, example code is asked for, but first, I just want to see if I am on the right track.
I only need certain entries out of each tag, like the eventdatetime, userid, etc. I have written programs that pull certain information out of files, but they have been csv files or pipe delimited. So it is mostly how to work with the format of this particular file that I need some assistance with.
20130628:123617.916:<?xml version="1.0" encoding="UTF-8"?><AuditMessage xmlns:xsi="http://www.someurlhere.com" xsi:noNamespaceSchemaLocation="http://infosolutions.someplace.com/audit/XYZauditmessagepayload.xsd"><EventIdentification EventActionCode="R" EventDateTime="20130628123209" EventID="100_ModuleAccess" EventOutcomeIndicator="0"></EventIdentification><UserIdentification RoleID="some role" UserID="abcdef">
The file has multiple entries like this and I am only submitting a portion because a lot of it contains protected information. Before I start any coding, my question is, would it be easier to remove the digits preceding the xml code and use the built in xml parser (if that is even possible) or should I just somehow use the <> as delimiters or is there an even better way that I am not aware exists.
If I left out necessary information, I am sorry. I am just starting in the field and I know I have a lot to learn. I know typically, example code is asked for, but first, I just want to see if I am on the right track.
I only need certain entries out of each tag, like the eventdatetime, userid, etc. I have written programs that pull certain information out of files, but they have been csv files or pipe delimited. So it is mostly how to work with the format of this particular file that I need some assistance with.