Splunk Search

Linegraph with Datestring / Convert Timestamp to _time

HeinzWaescher
Motivator

Hi,

I've got a lookupfile with a timestamp (in seconds) and other entries. I've converted the timestamp into a datestring to make it readable (eval Date=strftime(timestamp), "%d.%m.%Y" ) and used a | stats ... by Date command. In a table thats fine, all stats are grouped by the Date.

But when I want to create a Visualization the entries on the X-Axis (the Dates) are not readable. Is there a way to avoid this? Or perhaps it's useful/possible to convert the timestamp to "_time" here and create everything as a timechart?

Thanks in advance for your ideas.

Heinz

Tags (2)
0 Karma

HeinzWaescher
Motivator

I just tried something out: I used the example above, but used a Unixtimestamp as Date and tried to use this timestamp in a timechart.

... | rename _time AS Eventtime | rename Date as _time | ... | timechart span=1d ... | where _time<=now() AND _time>=strptime("01.10.2013", "%d.%m.%Y")

In my opinion it seems to work. If somebody knows that this kind of transformation causes problems I haven't found out yet, please let me know 😉

0 Karma

HeinzWaescher
Motivator

Hi somesoni2,

the table looks like this in the end (unfortunately i don't know how to add a table here...)

Date | A | B | C

27.10.2013 | 100 | 67 | 67

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Could you post some sample data from the table your got after your stats command?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...