From 760f29c1db5c6aa26212b19b57cd1bb8181ee423 Mon Sep 17 00:00:00 2001 From: Frederic Dartayre <30438455+fdartayre@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:52:17 +0200 Subject: [PATCH] Fix invalid jq command in hotspotting docs (#106121) --- .../troubleshooting/common-issues/hotspotting.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/troubleshooting/common-issues/hotspotting.asciidoc b/docs/reference/troubleshooting/common-issues/hotspotting.asciidoc index a8ca4c7d851d1..2cd33723bc42c 100644 --- a/docs/reference/troubleshooting/common-issues/hotspotting.asciidoc +++ b/docs/reference/troubleshooting/common-issues/hotspotting.asciidoc @@ -206,7 +206,7 @@ to process the output saved as `indices_stats.json`: [source,sh] ---- -cat indices_stats.json | jq -rc ['.indices|to_entries[]|.key as $i|.value.shards|to_entries[]|.key as $s|.value[]|{node:.routing.node[:4], index:$i, shard:$s, primary:.routing.primary, size:.store.size, total_indexing:.indexing.index_total, time_indexing:.indexing.index_time_in_millis, total_query:.search.query_total, time_query:.search.query_time_in_millis } | .+{ avg_indexing: (if .total_indexing>0 then (.time_indexing/.total_indexing|round) else 0 end), avg_search: (if .total_search>0 then (.time_search/.total_search|round) else 0 end) }'] > shard_stats.json +cat indices_stats.json | jq -rc '[.indices|to_entries[]|.key as $i|.value.shards|to_entries[]|.key as $s|.value[]|{node:.routing.node[:4], index:$i, shard:$s, primary:.routing.primary, size:.store.size, total_indexing:.indexing.index_total, time_indexing:.indexing.index_time_in_millis, total_query:.search.query_total, time_query:.search.query_time_in_millis } | .+{ avg_indexing: (if .total_indexing>0 then (.time_indexing/.total_indexing|round) else 0 end), avg_search: (if .total_search>0 then (.time_search/.total_search|round) else 0 end) }]' > shard_stats.json # show top written-to shard simplified stats which contain their index and node references cat shard_stats.json | jq -rc 'sort_by(-.avg_indexing)[]' | head