Splunk Dev

Extract values from a multivalue-field

shoermann
Explorer

I have a multi-value field that contains IP-Adr and MAC-Adr and want to seprate them into single value fields. Sounds easy but the name of the field is 'host.address{@addr}', because of the xml-parsing.

Something like the following doesn't work because of "Error in 'eval' command: The expression is malformed. Expected ).":

index=network_nmap host.address{@addr}=*
| eval test=mvindex(host.address{@addr},0)

What's my way out? Thanks in advance.

Tags (1)
0 Karma
1 Solution

rjthibod
Champion

Have you tried wrapping the field name in single or double quotes.

Like this:

`| eval test=mvindex("host.address{@addr}",0)`

or

`| eval test=mvindex('host.address{@addr}',0)`

View solution in original post

0 Karma

shoermann
Explorer

I just tried it with double quotes but it works with single ones.

0 Karma

rjthibod
Champion

Have you tried wrapping the field name in single or double quotes.

Like this:

`| eval test=mvindex("host.address{@addr}",0)`

or

`| eval test=mvindex('host.address{@addr}',0)`
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...