Splunk Search

Fields extraction from multi lines event

ali_alnajjar_ve
Explorer

Hello folks,
I've this event from custom data source:

01/07/2019 16:27:08
type=cpu_util
SNMP table: HOST-RESOURCES-MIB::hrProcessorTable
hrProcessorFrwID hrProcessorLoad
SNMPv2-SMI::zeroDotZero 20
SNMPv2-SMI::zeroDotZero 17
SNMPv2-SMI::zeroDotZero 19
SNMPv2-SMI::zeroDotZero 23
SNMPv2-SMI::zeroDotZero 10
SNMPv2-SMI::zeroDotZero 22
SNMPv2-SMI::zeroDotZero 8
SNMPv2-SMI::zeroDotZero 4
SNMPv2-SMI::zeroDotZero 7
SNMPv2-SMI::zeroDotZero 3
SNMPv2-SMI::zeroDotZero 4
SNMPv2-SMI::zeroDotZero 6
SNMPv2-SMI::zeroDotZero 33
SNMPv2-SMI::zeroDotZero 14
SNMPv2-SMI::zeroDotZero 13
SNMPv2-SMI::zeroDotZero 8

this is a one event that represents the utilization for the cpu cores. how to extract the numbers in each row ? I tried but it extract the first number only (20) . how to write regex to extract all numbers.

0 Karma

FrankVl
Ultra Champion

Use a REPORT extraction and add MV_ADD = true in your transforms.conf. For example:

props.conf

[mysourcetype]
REPORT-cpu_util = my_cpu_util

transforms.conf

[my_cpu_util]
REGEX = SNMPv2-SMI::zeroDotZero\s+(?<cpu_util>\d+)
MV_ADD = true

This should result in a multi valued field called cpu_util.

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...