Splunk Search

How to create a chart with static values from log file?

ketanadkar1
New Member

Hi

I have extracted 2 fields from log file & now I have to show a chart based on these 2 values. How can I do that? The value of these fields will be derived from the log file.

Field 1 - Process name
Field 2 - process count.

I need to show a chart which shows count of each process by host.
As of now I am using the table command to show a table but I want a chart. Any help is much appreciated.

Search:

index=* sourcetype=* | rex field=proc_monitor "\-\s(?(.*))count" |rex field=proc_monitor "count\s\:(?(.*))\;" | where proc_name NOT NULL|rename proc_name as "Process Name"|rename proc_count as "Total Count"|table host "Process Name" "Total Count" 

Log sample:

  • RTP count : 1 ; Status: UP
  • abc count : 16 ; Status: UP
  • def count : 26 ; Status: UP
  • ghi count : 13 ; Status: UP
0 Karma

sundareshr
Legend

Try this

 index=* sourcetype=* | rex field=proc_monitor "\-\s(?(.*))count" |rex field=proc_monitor "count\s\:(?(.*))\;" | where proc_name NOT NULL|rename proc_name as "Process Name"|rename proc_count as "Total Count"| chart sum(proc_count) as "Total Count" over host by "Process Name" 
0 Karma

ketanadkar1
New Member

Thanks for the reply however this is not working.... its showing me no results found.

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!

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

All Work and No Play? Not at .conf26! Unwind at These Evening Events

Between hands-on technical sessions, keynote reveals, and diving into live architectures, .conf26 is packed ...

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...