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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...