출력으로 ES가있는 filebeat를 사용 중입니다. 내가 지정한 : input_type : log document_type : apache 경로 : -/var/log/httpd/* _log /etc/filebeat/filebeat.yml에 있고 키바 나의 결과를 성공적으로 볼 수 있습니다. 그러나 나는 "감시자"와 놀고있어 HTTP 반환 코드 404를 기반으로 시계를 만들려고합니다. "키프로스 파일 비트 결과에는"응답 "과 같은"404 "에만 해당하는 필드가 없습니다. 나는 filebeat와 ELK가 큰 제품이기 때문에 무언가를 놓치고 싶다. 도움을 주시면 고맙겠습니다.파일 응답의 Apache 응답 필드 이름
0
A
답변
0
Filebeat는 각 이벤트의 message
필드에서 "있는 그대로"로그 라인을 전달합니다. 메시지를 추가로 처리하여 응답 코드와 같은 세부 정보를 자신의 필드에 추출하려면 Logstash를 사용할 수 있습니다.
Logstash에서을 사용하여 Filebeat에서 데이터를 수신 한 다음 grok filter을 적용하여 메시지의 데이터를 구문 분석 한 다음 elasticsearch 출력을 사용하여 Elasticsearch에 데이터를 쓸 수 있습니다.
0
Logstash를 사용하는 대신 Elasticsearch에 적합한 파이프 라인 인 "Ingest Node"를 사용할 수 있습니다.
https://www.elastic.co/guide/en/beats/filebeat/5.0/configuring-ingest-node.html
당신은 grok 수의 프로세서를 포함하는 파이프 라인을 설정할 수 있습니다
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/grok-processor.html
나는이 pipeline.json
파일 이런 짓을 :
{
"description": "Combined Apache Log Pipeline",
"processors": [
{
"grok": {
"field": "message",
"patterns": [ "%{COMBINEDAPACHELOG}" ]
}
}
]
}
그때 실행이 명령을 클러스터에 파이프 라인을 배포하려면
,curl -XPUT 'http://node-01.example.com:9200/_ingest/pipeline/combined-apache-log' [email protected]
마지막으로, 파이프 라인 이벤트를 처리 할 Elasticsearch 출력을 알려 filebeat.yml 업데이트 :
#================================ Outputs =====================================
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts:
- "192.168.0.1:9200"
- "192.168.0.2:9200"
- "192.168.0.3:9200"
loadbalance: true
pipeline: combined-apache-log
이 Logstash 없이도 작동하는이 나타납니다.
나는 응답, 참조 자, 응답 등의 필드를 확실히보고 있습니다.