mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elastic: Add id field to Elastic responses to allow permalinking (#73382)
* add `id` field to elasticsearch * add comment * slightly better perf * only add `id` to logs frames * only add `id` for logs responses * concat `index` and `id` * change snapshot generation to false * use better loop * fix tests * moved up
This commit is contained in:
@@ -131,6 +131,12 @@ func processLogsResponse(res *es.SearchResponse, target *Query, configuredFields
|
||||
}
|
||||
}
|
||||
|
||||
// we are going to add an `id` field with the concatenation of `_id` and `_index`
|
||||
_, ok := doc["id"]
|
||||
if !ok {
|
||||
doc["id"] = fmt.Sprintf("%v#%v", doc["_index"], doc["_id"])
|
||||
}
|
||||
|
||||
for key := range doc {
|
||||
propNames[key] = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user