Splunk Search

How to generate a search that will extract data from fields contained in a certain column?

hceylan97
New Member

I need to create a time series chart based on last_run and Total CPU Yields output from Sybase sysmon output file. I am currently indexing sysmon files the they look something like this:

last_run                        current_run                     seconds     
 ------------------------------- ------------------------------- ----------- 
             Jan 12 2017  1:43PM             Jan 12 2017  1:46PM         139 

Total CPU Yields                 2021.8          13.6      606554  

I need to come up with a search pattern to extract last_run and Total CPU Yields to chart. In this case, last_run is Jan 12 2017 1:43PM and Total CPU Yields is 13.6

how I can do this?

0 Karma

aaraneta_splunk
Splunk Employee
Splunk Employee

@hceylan97 - Were you able to test out woodcock's solution? Did it work? If yes, please don't forget to resolve this post by clicking on "Accept". If you still need more help, please provide a comment with some feedback. Thanks!

0 Karma

woodcock
Esteemed Legend

On ad ad-hoc basis, you can use rex like this:

 | rex field=raw "(?ms)(?<last_run>\w+\s+\d+\s+\d+\s+\d+:\d+\S+)\s+(?<current_run>\w+\s+\d+\s+\d+\s+\d+:\d+\S+)\s+(?<seconds>\d+).*Total\s+CPU\s+Yields\s+(?<last_yield>\S+)\s+(?<current_yield>\S+)\s+(?<seconds_yield>\S+)"
0 Karma

niketn
Legend

Have you tried to search your indexed data in verbose mode? How does each event look like? Are fields like CPU Yeilds extracted as interesting fields and belong to the same event with last_run and current_run time stamps?

If the fields are not already extracted you might have to extract them first (simplest way would be through rex), provided entire raw data belongs to the same event.

So if you can please share samples of raw events indexed.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...