First you have both the log and filestream enabled and pointed to the same logs, probably don't want that.
my log file (yours)
{"type":"LogType1","channel":2,"block":1,"page":3,"logging_time":"2021-06-25 19:23:30"}
{"type":"LogType2","channel":2,"block":1,"page":3,"logging_time":"2021-06-25 19:24:30"}
{"type":"LogType3","channel":2,"block":1,"page":3,"logging_time":"2021-06-25 19:25:30"}
My minimal filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
- /Users/sbrown/workspace/elastic-install/7.13.2/filebeat-7.13.2-darwin-x86_64/test_json.log
json.keys_under_root: true
json.add_error_key: true
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 1
setup.kibana:
output.elasticsearch:
hosts: ["localhost:9200"]
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
- add_docker_metadata: ~
- add_kubernetes_metadata: ~
- timestamp:
field: logging_time
layouts:
- '2006-01-02 15:04:05'
test:
- '2021-06-25 20:10:10'
my command
./filebeat -e -c ./filebeat-minimum.yml
My results Kibana - Dev Tools
GET filebeat-7.13.2-2021.06.27-000001/_search
{
"_source": false,
"fields": [ "*" ]
}
results
Note : the @timestamp
is set to logging_time
{
"took" : 43,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 3,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "filebeat-7.13.2-2021.06.27-000001",
"_type" : "_doc",
"_id" : "eF0KS3oBgW1UHy0ALsPE",
"_score" : 1.0,
"fields" : {
"logging_time" : [
"2021-06-25 19:23:30" <!---- logging_time
],
"host.os.name.text" : [
"Mac OS X"
],
"channel" : [
2
],
"host.hostname" : [
"ceres"
],
"type" : [
"LogType1"
],
"host.mac" : [
"8c:85:90:ae:b0:b2",
"82:de:c3:e6:d4:05",
"82:de:c3:e6:d4:04",
"82:de:c3:e6:d4:01",
"82:de:c3:e6:d4:00",
"82:de:c3:e6:d4:01",
"0e:85:90:ae:b0:b2",
"d6:54:f2:7a:9c:4c",
"d6:54:f2:7a:9c:4c",
"ac:de:48:00:11:22"
],
"host.os.build" : [
"20F71"
],
"host.ip" : [
"fe80::84d:3bc2:8250:27e0",
"192.168.2.205",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::377:1386:b3db:403e",
"fe80::fa7e:d5f1:2ea7:76ee",
"fe80::aede:48ff:fe00:1122"
],
"agent.type" : [
"filebeat"
],
"host.os.version" : [
"10.16"
],
"host.os.kernel" : [
"20.5.0"
],
"host.os.name" : [
"Mac OS X"
],
"block" : [
1
],
"agent.name" : [
"ceres"
],
"host.name" : [
"ceres"
],
"host.id" : [
"CB562E90-69DE-5D41-AC64-4EEDC79D5CB0"
],
"host.os.type" : [
"macos"
],
"input.type" : [
"log"
],
"log.offset" : [
0
],
"agent.hostname" : [
"ceres"
],
"host.architecture" : [
"x86_64"
],
"@timestamp" : [
"2021-06-25T19:23:30.000Z" <!--- Set to logging_time
],
"agent.id" : [
"1d5a1f47-65b3-4d65-bcaf-ad2f378e846c"
],
"host.os.platform" : [
"darwin"
],
"ecs.version" : [
"1.8.0"
],
"log.file.path" : [
"/Users/sbrown/workspace/elastic-install/7.13.2/filebeat-7.13.2-darwin-x86_64/test_json.log"
],
"agent.ephemeral_id" : [
"02a798bf-8b33-4341-b449-19068cde55d9"
],
"agent.version" : [
"7.13.2"
],
"page" : [
3
],
"host.os.family" : [
"darwin"
]
}
},
{
"_index" : "filebeat-7.13.2-2021.06.27-000001",
"_type" : "_doc",
"_id" : "eV0KS3oBgW1UHy0ALsPE",
"_score" : 1.0,
"fields" : {
"logging_time" : [
"2021-06-25 19:24:30"
],
"host.os.name.text" : [
"Mac OS X"
],
"channel" : [
2
],
"host.hostname" : [
"ceres"
],
"type" : [
"LogType2"
],
"host.mac" : [
"8c:85:90:ae:b0:b2",
"82:de:c3:e6:d4:05",
"82:de:c3:e6:d4:04",
"82:de:c3:e6:d4:01",
"82:de:c3:e6:d4:00",
"82:de:c3:e6:d4:01",
"0e:85:90:ae:b0:b2",
"d6:54:f2:7a:9c:4c",
"d6:54:f2:7a:9c:4c",
"ac:de:48:00:11:22"
],
"host.os.build" : [
"20F71"
],
"host.ip" : [
"fe80::84d:3bc2:8250:27e0",
"192.168.2.205",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::377:1386:b3db:403e",
"fe80::fa7e:d5f1:2ea7:76ee",
"fe80::aede:48ff:fe00:1122"
],
"agent.type" : [
"filebeat"
],
"host.os.version" : [
"10.16"
],
"host.os.kernel" : [
"20.5.0"
],
"host.os.name" : [
"Mac OS X"
],
"block" : [
1
],
"agent.name" : [
"ceres"
],
"host.name" : [
"ceres"
],
"host.id" : [
"CB562E90-69DE-5D41-AC64-4EEDC79D5CB0"
],
"host.os.type" : [
"macos"
],
"input.type" : [
"log"
],
"log.offset" : [
88
],
"agent.hostname" : [
"ceres"
],
"host.architecture" : [
"x86_64"
],
"@timestamp" : [
"2021-06-25T19:24:30.000Z"
],
"agent.id" : [
"1d5a1f47-65b3-4d65-bcaf-ad2f378e846c"
],
"host.os.platform" : [
"darwin"
],
"ecs.version" : [
"1.8.0"
],
"log.file.path" : [
"/Users/sbrown/workspace/elastic-install/7.13.2/filebeat-7.13.2-darwin-x86_64/test_json.log"
],
"agent.ephemeral_id" : [
"02a798bf-8b33-4341-b449-19068cde55d9"
],
"agent.version" : [
"7.13.2"
],
"page" : [
3
],
"host.os.family" : [
"darwin"
]
}
},
{
"_index" : "filebeat-7.13.2-2021.06.27-000001",
"_type" : "_doc",
"_id" : "el0KS3oBgW1UHy0ALsPE",
"_score" : 1.0,
"fields" : {
"logging_time" : [
"2021-06-25 19:25:30"
],
"host.os.name.text" : [
"Mac OS X"
],
"channel" : [
2
],
"host.hostname" : [
"ceres"
],
"type" : [
"LogType3"
],
"host.mac" : [
"8c:85:90:ae:b0:b2",
"82:de:c3:e6:d4:05",
"82:de:c3:e6:d4:04",
"82:de:c3:e6:d4:01",
"82:de:c3:e6:d4:00",
"82:de:c3:e6:d4:01",
"0e:85:90:ae:b0:b2",
"d6:54:f2:7a:9c:4c",
"d6:54:f2:7a:9c:4c",
"ac:de:48:00:11:22"
],
"host.os.build" : [
"20F71"
],
"host.ip" : [
"fe80::84d:3bc2:8250:27e0",
"192.168.2.205",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::d454:f2ff:fe7a:9c4c",
"fe80::377:1386:b3db:403e",
"fe80::fa7e:d5f1:2ea7:76ee",
"fe80::aede:48ff:fe00:1122"
],
"agent.type" : [
"filebeat"
],
"host.os.version" : [
"10.16"
],
"host.os.kernel" : [
"20.5.0"
],
"host.os.name" : [
"Mac OS X"
],
"block" : [
1
],
"agent.name" : [
"ceres"
],
"host.name" : [
"ceres"
],
"host.id" : [
"CB562E90-69DE-5D41-AC64-4EEDC79D5CB0"
],
"host.os.type" : [
"macos"
],
"input.type" : [
"log"
],
"log.offset" : [
176
],
"agent.hostname" : [
"ceres"
],
"host.architecture" : [
"x86_64"
],
"@timestamp" : [
"2021-06-25T19:25:30.000Z"
],
"agent.id" : [
"1d5a1f47-65b3-4d65-bcaf-ad2f378e846c"
],
"host.os.platform" : [
"darwin"
],
"ecs.version" : [
"1.8.0"
],
"log.file.path" : [
"/Users/sbrown/workspace/elastic-install/7.13.2/filebeat-7.13.2-darwin-x86_64/test_json.log"
],
"agent.ephemeral_id" : [
"02a798bf-8b33-4341-b449-19068cde55d9"
],
"agent.version" : [
"7.13.2"
],
"page" : [
3
],
"host.os.family" : [
"darwin"
]
}
}
]
}
}