return"",fmt.Errorf("missing time column argument for macro %v",name)
return"",fmt.Errorf("missing time column argument for macro %v",name)
}
}
returnfmt.Sprintf("%s BETWEEN '%s' AND '%s'",args[0],m.timeRange.GetFromAsTimeUTC().Format(time.RFC3339),m.timeRange.GetToAsTimeUTC().Format(time.RFC3339)),nil
returnfmt.Sprintf("%s BETWEEN FROM_UNIXTIME(%d) AND FROM_UNIXTIME(%d)",args[0],m.timeRange.GetFromAsSecondsEpoch(),m.timeRange.GetToAsSecondsEpoch()),nil
case"__timeGroup":
case"__timeGroup":
iflen(args)<2{
iflen(args)<2{
return"",fmt.Errorf("macro %v needs time column and interval",name)
return"",fmt.Errorf("macro %v needs time column and interval",name)