Splunk AppDynamics

Manipulate datetime in Alert Template

Morelz
Motivator

Hi there

Does anyone have a way to manipulate the time in an alert template. It'showing the event time in UTC time, not in the customer's time

We have SaaS Controllers which are in Europe however the customer is in a different timezone, however from AppD Support it seems we cannot update the time in the Alert.

This obviously causes confusion when the customer sees the event time is out by a couple of hours 

Surely there is a way to add/subtract hours in the template itself?

Any help is appreciated:)

Labels (3)
Tags (2)
0 Karma
1 Solution

Morelz
Motivator

For anybody else looking for this, please find working code below, we are GMT+2

You can change the code to fit your needs

#set ($date = ${latestEvent.eventTime})
#set ($newDate = ${date.getHours()}+(2))
$date.setHours(${newDate})
#set( $String = ' ' ) $String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tSZ', ${date})

View solution in original post

Morelz
Motivator

For anybody else looking for this, please find working code below, we are GMT+2

You can change the code to fit your needs

#set ($date = ${latestEvent.eventTime})
#set ($newDate = ${date.getHours()}+(2))
$date.setHours(${newDate})
#set( $String = ' ' ) $String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tSZ', ${date})

Get Updates on the Splunk Community!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...