how do i add a type field inside document from filebeat? I know i can add fields.type, something like:
paths:
- /var/log/httpd/error_log
fields:
type: httpd_error_log
instead of using:
paths:
- /var/log/httpd/error_log
document_type: httpd_error_log
Is this more efficent to just query logs of httpd_error_log and retrieve all messages of that type?
These are two sample docs i have now:
tasker log type:
{
"_index": "filebeat-2016.10.04",
"_type": "tasker",
"_id": "AVePp7jp1UM0xgwSbV9J",
"_score": null,
"_source": {
"@timestamp": "2016-10-04T10:25:16.388Z",
"beat": {
"hostname": "rc02",
"name": "rc02"
},
"fields": {
"asset_tag": "822-101-xxxx"
},
"input_type": "log",
"message": "Oct 04 12:25:15 : [LOG0] Deleting task #42508 which has expired",
"offset": 825908,
"source": "/usr/bp/logs.dir/tasker-9.log",
"type": "tasker"
},
"fields": {
"@timestamp": [
1475576716388
]
},
"sort": [
1475576716388
]
}
bpserver-backup type log:
{
"_index": "filebeat-2016.10.04",
"_type": "bpserver-backup",
"_id": "AVePp2Em1UM0xgwSbV2N",
"_score": null,
"_source": {
"@timestamp": "2016-10-04T10:24:54.050Z",
"beat": {
"hostname": "rc02",
"name": "rc02"
},
"fields": {
"asset_tag": "822-101-xxx"
},
"input_type": "log",
"message": "Oct 04 12:24:48 : [LOG0] Load average....: 0.6\n ",
"offset": 10858,
"source": "/usr/bp/logs.dir/bpserver-backup-9.log",
"type": "bpserver-backup"
},
"fields": {
"@timestamp": [
1475576694050
]
},
"sort": [
1475576694050
]
}
thanks