Skip to content

Fix #34: use fields.yml for export template so properties and @timest…#40

Open
deepujain wants to merge 1 commit intoeBay:masterfrom
deepujain:issue-34
Open

Fix #34: use fields.yml for export template so properties and @timest…#40
deepujain wants to merge 1 commit intoeBay:masterfrom
deepujain:issue-34

Conversation

@deepujain
Copy link
Copy Markdown
Contributor

Summary of fix
Fixes #34. The export template output previously had empty "properties": {}, which led to @timestamp being mapped as a string 1. This change wires the beat to the repo’s fields definition so the exported template has the right mappings.

Changes made

  • \meta/fields.yml – Define fields used for template generation: @timestamp (type date), beat (group: hostname, name, version as keyword), type (keyword), and existing counter (long).
  • nvidiagpubeat.yml – Set setup.template.fields: "_meta/fields.yml" so export template and setup use this file instead of the empty embedded asset.
  • README.md – Add an “Export index template” section: run ./nvidiagpubeat -c nvidiagpubeat.yml export template and note that the config points at _meta/fields.yml for correct mappings.

Verification
Run from repo root:
`
./nvidiagpubeat -c nvidiagpubeat.yml export template
{
"index_patterns": [
"nvidiagpubeat-6.5.5-*"
],
"mappings": {
"doc": {
"_meta": {
"version": "6.5.5"
},
"date_detection": false,
"dynamic_templates": [
{
"strings_as_keyword": {
"mapping": {
"ignore_above": 1024,
"type": "keyword"
},
"match_mapping_type": "string"
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"beat": {
"properties": {
"hostname": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"counter": {
"type": "long"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
},
"order": 1,
"settings": {
"index": {
"mapping": {
"total_fields": {
"limit": 10000
}
},
"number_of_routing_shards": 30,
"refresh_interval": "5s"
}
}
}

`

The JSON now has non-empty mappings.doc.properties with @timestamp as date, plus beat, counter, type.

Request to eBay maintainer
Please review and merge this PR when convenient. Thank you.

…mestamp are correct

- Expand _meta/fields.yml with @timestamp (date), beat, type for template generation
- Add setup.template.fields in nvidiagpubeat.yml so export template uses it
- README: add Export index template section (fixes eBay#34, eBay#15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong template exported by nvidiagpubeat

1 participant