Splunk Search

Need help in creating graphs for a value extracted from log

Devi13
Path Finder

Hello Team,

I have log like this,

File Records count is 2

File Records count is 5

File Records count is 45

File Records count is 23

and I have extracted the values 2,5,45,23 as a separate field called Count.

When I use "base search| table Count"  I am getting the expected value in a stats table

But I want 2,5,45,23 to be plotted in the line graph.

I tried stats commands but its only showing the no. of events of Count but not the values of count.

Could you please provide your assistance on how can I plot the values of Count into a graph.

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Devi13,

probably the Counts are strings, so did you tried to convert them in numbers using eval tonumber (https://docs.splunk.com/Documentation/Splunk/9.1.1/SearchReference/ConversionFunctions#tonumber.28.2...)?

base search
| eval Count=tonumber(Count)
| table Count

 Ciao.

Giuseppe

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Have you tried creating a dashboard and adding a panel of the chart type you want, then using your search as the data source?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Devi13,

probably the Counts are strings, so did you tried to convert them in numbers using eval tonumber (https://docs.splunk.com/Documentation/Splunk/9.1.1/SearchReference/ConversionFunctions#tonumber.28.2...)?

base search
| eval Count=tonumber(Count)
| table Count

 Ciao.

Giuseppe

Devi13
Path Finder

Hello @gcusello , Thank you that worked.

Hello @ITWhisperer , yeahh now we are getting the results as expected.

Thank you for your help.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...