Refine your search:

I have a field in my Apache logs that's defined as "MicroSeconds". This is the response time in microseconds for a specific call in Apache to our Weblogic back ends.

I'm trying to generate a real time chart on the average response times based on the "Microseconds" field. I'd like to be able to convert microseconds to milliseconds so I don't freak out our users when they see a transaction hit 4000..

How would I do that? The basic search right now is:

index="uat_apache_logs" /pbng | timechart avg(MicroSeconds) 

which works good..I just need to convert it to milliseconds..

Thanks in advance.

asked 26 Apr '10, 17:53

Brian%20Osburn's gravatar image

Brian Osburn
2.8k13
accept rate: 22%

edited 07 Sep '11, 14:27

jlaw's gravatar image

jlaw ♦
20113

How did you define the field in Splunk? I assume you are using the Apache response time option in the log format?

Thanks

Ed

(26 Apr, 13:12) ebailey

One Answer:

You can use the "eval" command to perform operations in field values: http://www.splunk.com/base/Documentation/latest/SearchReference/Eval

In your case:

... | timechart avg(MicroSeconds) as avgus | eval avg_milliseconds = avgus/1000
link

answered 26 Apr '10, 18:46

gkanapathy's gravatar image

gkanapathy ♦
26.2k1622
accept rate: 42%

That works. Anyway to make drilldown work with this? I get a "# PARSER: Applying intentions failed Unable to drilldown because of post-reporting 'eval' command"

Brian

(26 Apr '10, 19:18) Brian Osburn
1

Answer is disarmingly simple - just do the eval before the timechart instead of after. "eval milliseconds=MicroSeconds*1000 | timechart avg(milliseconds)"

(26 Apr '10, 19:41) nick ♦
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:

×351
×333
×128

Asked: 26 Apr '10, 17:53

Seen: 1,197 times

Last updated: 26 Apr, 13:12

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