Splunk Search

graphing over time between values

rdb_splunk
Explorer

02/27/2013 21:59 UTC Media Table Statistics.Unique Media Files.value=6277
02/27/2013 20:59 UTC Media Table Statistics.Unique Media Files.value=6272
02/27/2013 19:59 UTC Media Table Statistics.Unique Media Files.value=6272
02/27/2013 18:59 UTC Media Table Statistics.Unique Media Files.value=6264

HI there,

I have been trying to figure out the rex, for the above, and just can't get it right. The idea is to graph the change in value of Unique Media Files.value=6277 over time. At the moment you can see the time 21:59 and 20:59,etc. These values e.g. value=6277, value=6272, change over time, and I am trying to plot this change over time, in a line graph.

Any ideas? And has anyone got a good rex resource they can recommend, so I can learn, outside of Splunk. Thanks for the help everyone.

Tags (1)

sideview
SplunkTrust
SplunkTrust

Well you don't have to match all the twiddly bits of the entire event, so the rex can be pretty simple. This one seems to work just fine:

| rex "Unique Media Files.value=(?<media_file_count>\d+)"

This will create a field called "media_file_count" on that row, whose value is 6577

To get a little fancier, this looks a little like SCADA data, in that it's a fairly complicated tag or point name, and a simple value. To the extent that you might have a broad hierarchy of such tag names here, you could do something more generic, like so:

| rex "\d+/\d+/\d+ \d+:\d+ \w+ (?<point_name>.+)??.value=(?<point_value>\d+)" | eval {point_name}=point_value

that will actually create a Splunk field called "Media Table Statistics.Unique Media Files", whose value is 6577

So if you were to run this search over all your data, it would actually sort of break out your data nicely.

| rex "\d+/\d+/\d+ \d+:\d+ \w+ (?<point_name>.+)??.value=(?<point_value>\d+)" | eval {point_name}=point_value

The Sideview Process Historian app actually takes data that looks a lot like this, and it automatically carves up that "foo.bar.baz" hierarchy and makes the whole dataset browsable and pivotable. the app is currently in a bit of a decommissioned state while the 2.0 version is being finalized, but feel free to email me if that is indeed SCADA data and your naming scheme is consistent enough that it might enjoy some nice automatic browse/report functionality.

0 Karma

rdb_splunk
Explorer

Thanks very much for your answer,

I ended up using something like this,

"Unique Media Files.value=*" | rex "Unique Media Files.value=(?\d+)" | timechart span=60m avg(media_files_count) by sourcetype

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...