Skip to content

Commit a6476b2

Browse files
authored
Fix process.command_line mapping (#589)
* Remove multi-fields and change type to match text only * Update generate.sh to remove multifields from process and agent.host * Fix jq command * Change wildcard type to keyword
1 parent 82c649a commit a6476b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ecs/generate.sh

+8
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ remove_multi_fields() {
1919
local OUT_FILE="$2"
2020

2121
jq 'del(
22+
.mappings.properties.agent.properties.host.properties.os.properties.full.fields,
23+
.mappings.properties.agent.properties.host.properties.os.properties.name.fields,
2224
.mappings.properties.host.properties.os.properties.full.fields,
2325
.mappings.properties.host.properties.os.properties.name.fields,
26+
.mappings.properties.process.properties.command_line.fields,
27+
.mappings.properties.process.properties.name.fields,
2428
.mappings.properties.vulnerability.properties.description.fields
2529
)' "$IN_FILE" > "$OUT_FILE"
2630
}
@@ -46,6 +50,10 @@ generate_mappings() {
4650
# Replace "constant_keyword" type (not supported by OpenSearch) with "keyword"
4751
echo "Replacing \"constant_keyword\" type with \"keyword\""
4852
find "$OUT_DIR" -type f -exec sed -i 's/constant_keyword/keyword/g' {} \;
53+
54+
# Replace "wildcard" type (showing as "unknown" on dashboard) with "keyword"
55+
echo "Replacing \"wildcard\" type with \"keyword\""
56+
find "$OUT_DIR" -type f -exec sed -i 's/wildcard/keyword/g' {} \;
4957

5058
# Replace "flattened" type (not supported by OpenSearch) with "flat_object"
5159
echo "Replacing \"flattened\" type with \"flat_object\""

0 commit comments

Comments
 (0)