Refine your search:

On a *NIX monolithic search-head/indexer, what is the best method to determine Splunk's CPU load by search at a point in time (no need to calculate avg, etc.)? We are looking to build a report to display something like this:

search index=os sourcetype=ps | multikv     8%     
search index=netapp_perf object=system | ...     5%

Cheers, Ron

asked 15 Nov '11, 09:54

Ron%20Naken's gravatar image

Ron Naken
3.0k320
accept rate: 35%

edited 18 Nov '11, 12:09

araitz's gravatar image

araitz ♦♦
7.1k2516


2 Answers:

Thanks, here's the solution:

index=os sourcetype=ps | multikv | search COMMAND=splunkd | rex field=_raw "search_--id=(?<srid>[^-]+)(?=_)" | search srid=* | join srid [search index=_audit search_id=* search=* | rex field=search_id "'?(?<srid>[^']+)" | fields srid search] | table _time user search pctCPU

Cheers, Ron

link

answered 18 Nov '11, 07:43

Ron%20Naken's gravatar image

Ron Naken
3.0k320
accept rate: 35%

edited 18 Nov '11, 07:45

Nice answer!

(18 Nov '11, 07:45) lguinn ♦

If you really wanted to see CPU usage at a point in time, you could collect the data via the *NIX ps command. Each search in Splunk runs as a separate process. You could even correlate the CPU usage back to the specific search using the search id, which appears in the process information.

The *NIX app has a script that runs the ps command and indexes its output. You just need to enable it - and then write the searches to analyze the data.

Another approach, if you want to look at CPU usage over time: Splunk keeps information about each search that it runs in the _audit index. You can see some of the statistics that can be computed, if you are logged into Splunk as an admin. From the Search app, choose the Status menu (between Search and Views in the menu bar). Then choose "Search Activity" and "Search Details." This dashboard will show the most common and the most expensive searches.

link

answered 17 Nov '11, 23:32

lguinn's gravatar image

lguinn ♦
3.1k216
accept rate: 24%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,089
×30
×3

Asked: 15 Nov '11, 09:54

Seen: 635 times

Last updated: 18 Nov '11, 12:09

Copyright © 2005-2012 Splunk, Inc. All rights reserved.