Splunk Search

how to display time rightly in csv file

fzfeng
New Member

hello

I export my search result to csv file

but when I open it the time just display like this

1.52E+09

index=maillog I timechart span=1d,count(eval(IP=×××)) as IP1 I outputcsv IP1

Tags (1)
0 Karma

TISKAR
Builder

@fzfeng, can you try | convert ctime(_time) please, that work for me:

index=_internal
| timechart span=1d count(eval(log_level=INFO)) as countInfo 
| convert ctime(_time)
| outputcsv  tst.csv
0 Karma

mayurr98
Super Champion

Can you try this :

This is more efficient

index=maillog IP=XXXX | bin _time span=1d | stats count as IP1 by _time
0 Karma

fzfeng
New Member

thank you I tried it

and i set the time range one month

the graph it displaied 3/27 3/29 3/31 4/2 4/4 .....

but the table displaied 3/37 3/28 3/29 3/31 4/1 4/2 ....

0 Karma

janispelss
Path Finder

If the table has all the days, then everything is correct. The graph has all data points, it's just that not all labels are shown.

0 Karma

fzfeng
New Member

OK thank you very much

0 Karma

ssadanala1
Contributor

Are you seeing the issue when you are running |inputcsv IP1 .?

My understanding is that you are seeing the display 1.52E+09 when you download and open in excel .
If that is the case please increase the width size of the cell which gives excel enough space to display the value .

Thanks

0 Karma
Get Updates on the Splunk Community!

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureThursday, March 27, 2025  |  11AM PST / 2PM EST | Register NowStep boldly ...

Splunk AppDynamics with Cisco Secure Application

Web applications unfortunately present a target rich environment for security vulnerabilities and attacks. ...