Commit 0e7c746a by Chad Nedzlek Committed by GitHub

Azure Monitor: Fix app insights source to allow for new __timeFrom and __timeTo (#21879)

* Fix app insights source to allow for new __timeFrom and __timeTo

* Try fixing the switch
parent cd42b31d
...@@ -60,9 +60,9 @@ func (m *kqlMacroEngine) evaluateMacro(name string, args []string) (string, erro ...@@ -60,9 +60,9 @@ func (m *kqlMacroEngine) evaluateMacro(name string, args []string) (string, erro
timeColumn = args[0] timeColumn = args[0]
} }
return fmt.Sprintf("['%s'] >= datetime('%s') and ['%s'] <= datetime('%s')", timeColumn, m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339), timeColumn, m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil return fmt.Sprintf("['%s'] >= datetime('%s') and ['%s'] <= datetime('%s')", timeColumn, m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339), timeColumn, m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil
case "__from": case "__timeFrom", "__from":
return fmt.Sprintf("datetime('%s')", m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339)), nil return fmt.Sprintf("datetime('%s')", m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339)), nil
case "__to": case "__timeTo", "__to":
return fmt.Sprintf("datetime('%s')", m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil return fmt.Sprintf("datetime('%s')", m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)), nil
case "__interval": case "__interval":
var interval time.Duration var interval time.Duration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment