diff --git a/cmd/bosun/expr/logstash.go b/cmd/bosun/expr/logstash.go index f25ca6933e..38021f3b5a 100644 --- a/cmd/bosun/expr/logstash.go +++ b/cmd/bosun/expr/logstash.go @@ -122,6 +122,10 @@ func (e *LogstashElasticHosts) GenIndices(r *LogstashRequest) (string, error) { if err != nil { return "", err } + // Short-circut when using concrete ES index name + if strings.HasSuffix(r.IndexRoot, "/") { + return r.IndexRoot[:len(r.IndexRoot)-1], nil + } indices, err := lsClient.IndexNames() if err != nil { return "", err @@ -147,7 +151,7 @@ func (e *LogstashElasticHosts) GenIndices(r *LogstashRequest) (string, error) { } } if len(selectedIndices) == 0 { - return "", fmt.Errorf("no elastic indices available during this time range") + return "", fmt.Errorf("no elastic indices available during this time range, index[%s]", r.IndexRoot) } return strings.Join(selectedIndices, ","), nil }