Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Captain
Captain
376 views

XML parsing error

Hello ,

I'm new on XML Flex developpement.  I must develop a flex for the below XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Log SYSTEM "CELLO_SECURITYEVENT_LOG.dtd">
<Log>
<LogCreated>
<LogName> CELLO_SECURITYEVENT_LOG </LogName>
<TimeStamp>
<year> 2015 </year> <month> 8 </month> <day> 26 </day>
<hour> 19 </hour> <minute> 33 </minute> <second> 44 </second>
</TimeStamp>
<AdditionalLogInfo>  </AdditionalLogInfo>
</LogCreated>                       
<LogRecord number = "6050">
<TimeStamp>
<year> 2015 </year> <month> 8 </month> <day> 26 </day>
<hour> 19 </hour> <minute> 33 </minute> <second> 44 </second>
</TimeStamp>
<RecordContent>
<Event> TCPConnectionClosed </Event>
<RemoteHost> /10.180.100.3 </RemoteHost> <RemotePort> 49851 </RemotePort>
<LocalPort> 64358 </LocalPort>
<DN>  </DN>
</RecordContent>
</LogRecord>

I tried but my parser is not good . Could you please check were is the error ?
Find attached the flex file

# Tokenization Section

trigger.node.expression=//TimeStamp
additionaldata.enabled=true

hop.node.count=4

hop.node[7].name=Event
hop.node[7].expression=/Log/LogRecord/RecordContent/Event
hop.node[7].type=String
hop.node[8].name=RemoteHost
hop.node[8].expression=/Log/LogRecord/RecordContent/RemoteHost
hop.node[8].type=IPAddress
hop.node[9].name=RemotePort
hop.node[9].expression=/Log/LogRecord/RecordContent/RemotePort
hop.node[9].type=Integer
hop.node[10].name=LocalPort
hop.node[10].expression=/Log/LogRecord/RecordContent/LocalPort
hop.node[10].type=Integer


token.count=7

# Tokenization root Section
token[0].name=EventID
token[0].expression=/Log/LogRecord/@number/string()

# Tokenization (triger node )TimeStamp Section
token[1].name=year
token[1].expression=year
token[1].type=string
token[2].name=month
token[2].expression=month
token[2].type=string
token[3].name=day
token[3].expression=day
token[3].type=string
token[4].name=hour
token[4].expression=hour
token[4].type=string
token[5].name=minute
token[5].expression=minute
token[5].type=string
token[6].name=second
token[6].expression=second
token[6].type=string

# Regular mapping section

event.endTime=__createSafeLocalTimeStamp(__concatenate(year,month,day,hour,minute,second),"yyyy-MM-dd;HHmmss")
event.deviceCustomString1=EventID
event.message=Event
event.destinationAddress=RemoteHost
event.destinationPort=RemotePort
event.sourcePort=LocalPort


# Connector constants

event.deviceVendor=__stringConstant(MTN Guinee Bissau Flex)
event.categoryTechnique=__stringConstant("/MTN/MTN Telecommunication/Bissau/Policy")
event.categoryOutcome=__stringConstant("/Information/Investigate")
event.categoryBehavior=__stringConstant("/Modify/Configuration")
event.deviceProduct=__stringConstant("RNC Application")
event.categoryDeviceGroup=__stringConstant("/Application/RNC Application")
event.categoryObject=__stringConstant("/Host/Application/RNC Node")
event.categorySignificance=__stringConstant("/Informational/Warning")

# Severity mapping section

#severity.map.veryhigh.if.deviceSeverity=
#severity.map.high.if.deviceSeverity=
#severity.map.medium.if.deviceSeverity=
#severity.map.low.if.deviceSeverity=

Labels (3)
0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.