Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Logs

Status
Not open for further replies.

Cobby1812

IS-IT--Management
Jun 22, 2006
58
GB
Morning All,


I am trying to extract the User Name from an evt file as follows



CoID={xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}: The user xxxxxxxxxxx\Mark Cobb connected on port VPN2-119 has been assigned address 111.111.11.11




So the Mark Cobb is the Part I want to extract, obviously I am not the only person I need to extract so I need to find a generic way of getting all users after the xxxxxxxxxxx\ to be shown.


Any Idea's??
 
Look up the SPLIT and UBOUND commands. Split would separate text before and after a character or set of characters, in your case probably "/" and "connected". UBOUND would count the number of parts, in case that is variable.

Splits can be nested, or the output from one split can be used in another formula field that does a further split.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Assuming name is always preceeded by \ and name is always Firstname Surname

If above string is in the field

split(split({your field}, '\')[2], ' ')[1] Returmns Mark
split(split({your field}, '\')[2], ' ')[2] Returns Cobb

Ian

 
You can also utilise extractstring({eventlog.field},'\','connected') if the same string text is always utilised.

CR8.5 / CRXI - Discovering the impossible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top