Getting Data In

How can i change the time format in Splunk web?

Ayn
Legend

The default time format when showing logs in the web interface is mm/dd/yyyy and the time specified in 12h format. At my location (as in many other places outside the US or UK) another time format is used, dd/mm/yyyy + 24h time. How can I change so that the timestamps are presented in this format instead?

Tags (1)
1 Solution

Ron_Naken
Splunk Employee
Splunk Employee

You should be able to change this by specifying the locale ID in your URL when you access Splunk. Splunk URL's are in this format:

http://my.url.com:8000/[locale ID]/...

For instance, in the US, your Splunk server is most likely accessed with the en-US locale ID. For Great Britain, this would be en-GB. i.e. http://my.url.com:8000/en-GB

HTH, Ron

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

The Splunk docs @Simon refers to cover changing the message tags fairly well, but don't really speak to changing locale items like date/time formatting. The babel toolkit (which Splunkweb seems to depend on for some of this) has a whole series of separate localization configuration files located in $SPLUNK_HOME/lib/python2.6/site-packages/babel/localedata. These appear to be python pickled dictionaries. They could be edited, but not trivially. Anyone trying to do this needs to have a firm grasp on Python, babel and chunks of the unicode standards. It's definitely nontrivial, and nothing I'd attempt without a lot of testing.

Simon
Contributor

Hi all

Looking for the same options.

As here in Switzerland we got still another time format as in Great Britain (for example: 26.05.2010 12:22:13.671 instead of 26/05/2010 12:22:13.671) I'm still searching for a way to change the format.

In the docs I found a way to create an own translation (http://www.splunk.com/base/Documentation/latest/Developer/TranslateSplunk) but I'm not very familiar with these "pot" and "mot" files. Is there a way to just adjust the timestamp format in the translation files?

Thanks for helping Simon

Ron_Naken
Splunk Employee
Splunk Employee

You should be able to change this by specifying the locale ID in your URL when you access Splunk. Splunk URL's are in this format:

http://my.url.com:8000/[locale ID]/...

For instance, in the US, your Splunk server is most likely accessed with the en-US locale ID. For Great Britain, this would be en-GB. i.e. http://my.url.com:8000/en-GB

HTH, Ron

grijhwani
Motivator

Years on and this is - as far as I can tell - haunting us.

The choice of 24 hour clock isn't regional. Nor is, say, the preference for ISO dates. There needs to be an easy way to set the base standard for the local search instance.

w531t4
Path Finder

I think this article has a better solution, fwiw.

http://answers.splunk.com/answers/10265/change-default-web-ui-locale

0 Karma

Ayn
Legend

Thanks! Setting to en-GB works. However default locale here is sv or sv-SE, which Splunk doesn't support (at least not out of the box). So, failing that I want to set the default locale to en-GB instead of en-US.
The only way I've found to achieve this so far is to edit lib/python2.6/site-packages/splunk/appserver/mrsparkle/lib/i18n.py and replace en-US with en-GB at the following line:
locales = parse_accept_languages(request.headers.get('accept-language', 'en-US'))

I'm guessing since it's hardcoded there is no configuration directive for this...

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...