diff --git a/modules/core/monitor/log/storage/elasticsearch/iterator.go b/modules/core/monitor/log/storage/elasticsearch/iterator.go index bd2a87fccb1..ac75376758e 100644 --- a/modules/core/monitor/log/storage/elasticsearch/iterator.go +++ b/modules/core/monitor/log/storage/elasticsearch/iterator.go @@ -116,6 +116,18 @@ func (p *provider) Iterator(ctx context.Context, sel *storage.Selector) (storeki func getSearchSource(start, end int64, sel *storage.Selector) *elastic.SearchSource { searchSource := elastic.NewSearchSource() query := elastic.NewBoolQuery().Filter(elastic.NewRangeQuery("timestamp").Gte(start).Lt(end)) + + // compatiblity for source=deploy + isContainer := true + for _, filter := range sel.Filters { + if filter.Key != "source" { + continue + } + if val, ok := filter.Value.(string); ok && val != "container" { + isContainer = false + } + } + for _, filter := range sel.Filters { val, ok := filter.Value.(string) if !ok { @@ -126,6 +138,10 @@ func getSearchSource(start, end int64, sel *storage.Selector) *elastic.SearchSou continue } } + // compatiblity for source=deploy, ignore tags filters + if !isContainer && strings.HasPrefix(filter.Key, "tags.") { + continue + } switch filter.Op { case storage.EQ: query = query.Filter(elastic.NewTermQuery(filter.Key, val))