Skip to content

Commit 4dfd3e8

Browse files
Fix JQ command for processing mapping.json (#3830)
Updated command to process mapping.json output with JQ.
1 parent dae99f4 commit 4dfd3e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

troubleshoot/elasticsearch/mapping-explosion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To confirm the field totals of an index to check for mapping explosion:
5050
* If you’re inclined to use the [third-party tool JQ](https://stedolan.github.io/jq), you can process the [get mapping](../../manage-data/data-store/mapping.md) `mapping.json` output.
5151

5252
```sh
53-
$ cat mapping.json | jq -c 'to_entries[]| .key as $index| [.value.mappings| to_entries[]|select(.key=="properties") | {(.key):([.value|..|.type?|select(.!=null)]|length)}]| map(to_entries)| flatten| from_entries| ([to_entries[].value]|add)| {index: $index, field_count: .}'
53+
cat mapping.json | jq -c 'to_entries[]| .key as $index| [.value.mappings| to_entries[]|select(.key=="properties") | {(.key):([.value|..|.type?|select(.!=null)]|length)}]| map(to_entries)| flatten| from_entries| ([to_entries[].value]|add)| {index: $index, field_count: .}'
5454
```
5555

5656

0 commit comments

Comments
 (0)