今天在一個(gè)坑里待了2個(gè)小時(shí),明明配置是對(duì)的,但就是沒有起效。
當(dāng)前aaa.log日志為:
2017-02-14 11:52:18.772 [catalina-exec-74] DEBUG aaa - loginRespons:{
"status": "200",
"userId": "Pl016",
"userGroup": "0",
"areaCode": "9999",
"epgIndexType": "",
"epgIndex": "http://ip:58082/epg/api/page/biz_123456.json",
"testEpgIndex":"http://ip:58082/epg/api/page/biz_123456.json",
"epgServer": "http://ip:58082/epg/",
"aaaServer": "http://ip:58082/epg/",
userServer": "http://ip:58082/epg/",
}
日志到Logstash->elasticsearch->kibana中顯示成N個(gè)message,如"status": "200"為一行, "userId": "Pl016"為另外一行。
參考filebeat的官網(wǎng),在filebeat.yml中設(shè)置
filebeat.prospectors:
- input_type: log
document_type: aaa
paths:
- /opt/product/data/logs/epg/aaa*.*
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
multiline.negate: true
multiline.match: after
multiline.timeout: 10s
重啟容器,按道理是可以將非日期開頭的的行 合并到第一行中的。
但是就是不生效。試了很多次,改配置,依舊沒效果。
問題就出在:重啟容器。
我以為docker-compose up -d 可以重啟容器,但是事實(shí)并沒有來著,
該命令對(duì)應(yīng)含義:構(gòu)建,(重新)創(chuàng)建,啟動(dòng),鏈接一個(gè)服務(wù)相關(guān)的容器。

Paste_Image.png
虧呀,浪費(fèi)了大好時(shí)光。
學(xué)習(xí)要保持一顆嚴(yán)謹(jǐn)?shù)男摹?/p>