Skip to content

Commit

Permalink
Implement the creation of the Packages index template and index (#59)
Browse files Browse the repository at this point in the history
* Add wazuh-states-packages template

* Create packages index template upon plugin load
  • Loading branch information
f-galland authored Sep 13, 2024
1 parent 628d7a2 commit de31ddf
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public WazuhIndices(Client client, ClusterService clusterService) {
// Create Index Templates - Indices map
this.indexTemplates.put("index-template-agent", ".agents");
this.indexTemplates.put("index-template-alerts", "wazuh-alerts-5.x-0001");
this.indexTemplates.put("index-template-packages", "wazuh-states-inventory-packages");
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"index_patterns": [
"wazuh-states-inventory-packages*"
],
"mappings": {
"date_detection": false,
"dynamic": "strict",
"properties": {
"@timestamp": {
"type": "date"
},
"agent": {
"properties": {
"groups": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"package": {
"properties": {
"architecture": {
"ignore_above": 1024,
"type": "keyword"
},
"description": {
"ignore_above": 1024,
"type": "keyword"
},
"installed": {
"type": "date"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"path": {
"ignore_above": 1024,
"type": "keyword"
},
"size": {
"type": "long"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"order": 1,
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1",
"query.default_field": [
"agent.id",
"agent.groups",
"package.architecture",
"package.name",
"package.version",
"package.type"
],
"refresh_interval": "5s"
}
}
}

0 comments on commit de31ddf

Please sign in to comment.