- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below is the sample input for my search
BusinessIdentifier : 09 ***** MessageIdentifier : 3308b7dd-826c-4e98-8511-6a018c5f8bcc ***** TimeStamp : 2022-03-16T11:08:30.013Z ***** ElapsedTime : 0.25 ***** InterfaceName : NLTOnline ***** ServiceLayerName : OSB ***** ServiceLayerOperation : CreateQPBillingEvents ***** ServiceLayerPipeline : requestPipeline ***** SiteID : ***** DomainName : ***** ServerName : DEVserver ***** FusionErrorCode : ***** FusionErrorMessage : ***** <Body xmlns="http://schemas.xmlsoap.org/soap/envelope/"><com:createQPBillEvents xmlns:com="com.alcatel.lucent.on.ws.manager"> <com:ACTION_DATE>2021-08-30T23:59:59+08:00</com:ACTION_DATE> <com:ADR_BLDG_TYPE>HDB</com:ADR_BLDG_TYPE>
=============
I need to extract the values of the below
ElapsedTime : 0.25
InterfaceName : NLTOnline
ServiceLayerName : OSB
ServiceLayerOperation : CreateQPBillingEvents
ServiceLayerPipeline : requestPipeline
Using xmlkv its not working. can someone help to provide the right command?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![richgalloway richgalloway](https://community.splunk.com/legacyfs/online/avatars/140500.jpg)
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
xmlkv doesn't work because the event is not well-formed XML so it's rex to the rescue! 🙂
| rex "ElapsedTime : (?<ElapsedTime>\S+)"
| rex "InterfaceName : (?<InterfaceName>\S+)"
| rex "ServiceLayerName : (?<ServiceLayerName>\S+)"
| rex "ServiceLayerOperation : (?<ServiceLayerOperation>\S+)"
| rex "ServiceLayerPipeline : (?<ServiceLayerPipeline>\S+)"
If it weren't for the spaces around the colons, the extract command might have worked, but that's why we have rex.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![richgalloway richgalloway](https://community.splunk.com/legacyfs/online/avatars/140500.jpg)
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
xmlkv doesn't work because the event is not well-formed XML so it's rex to the rescue! 🙂
| rex "ElapsedTime : (?<ElapsedTime>\S+)"
| rex "InterfaceName : (?<InterfaceName>\S+)"
| rex "ServiceLayerName : (?<ServiceLayerName>\S+)"
| rex "ServiceLayerOperation : (?<ServiceLayerOperation>\S+)"
| rex "ServiceLayerPipeline : (?<ServiceLayerPipeline>\S+)"
If it weren't for the spaces around the colons, the extract command might have worked, but that's why we have rex.
If this reply helps you, Karma would be appreciated.
![](/skins/images/396DDBEEAC295EB5FEC41FF128E8AC0A/responsive_peak/images/icon_anonymous_message.png)