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
This commit is contained in:
Chad Nedzlek 2020-03-09 16:55:41 -07:00 committed by GitHub
parent cd42b31da5
commit 0e7c746a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,9 +60,9 @@ func (m *kqlMacroEngine) evaluateMacro(name string, args []string) (string, erro
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
case "__from":
case "__timeFrom", "__from":
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
case "__interval":
var interval time.Duration