java: logback、lo4j asp.net: log4net、nlog
filebeat.inputs: - type: log enabled: true paths: #- /var/log/*.log - F:\logs\xxx\*.log filebeat.config.modules: # Glob pattern for configuration loading path: ${path.config}/modules.d/*.yml # Set to true to enable config reloading reload.enabled: false output.logstash: # logstash地址和端口 hosts: ["192.168.3.43:5044"] processors: - add_host_metadata: ~ - add_cloud_metadata: ~ - add_docker_metadata: ~ - add_kubernetes_metadata: ~
2012-01-08 10:21:41.5296|0|INFO|logfile|windows service start... 2012-01-08 11:03:03.5926|0|INFO|logfile|windows service end... 2012-01-08 11:04:18.2756|0|INFO|logfile|windows service start... 2012-01-08 11:04:26.7556|0|INFO|logfile|測試0
D:\devops\filebeat-7.5.1-windows-x86_64>filebeat -e -c filebeat.yml ... 2020-01-08T14:06:16.038+0800 INFO [monitoring]...
更多信息詳見 filebeat官方文檔html
JAVA_HOME: C:\Program Files\jdk-11.0.5 CLASSPATH: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar PATH追加: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
java version "11.0.5" 2019-10-15 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode)
ES_HOME:C:\Program Files\elasticsearch-7.5.1 PATH追加:%ES_HOME%\bin;
cluster.name: elasticsearch-application node.name: node-1 network.host: 192.168.3.41 http.port: 9200 cluster.initial_master_nodes: ["node-1"] # 配置head cors http.cors.enabled: true http.cors.allow-origin: "*" node.master: true node.data: true
5.運行 elasticsearch7.5.1\bin\elasticsearch.bat, 訪問 192.168.3.41:9200, 顯示以下JSON字符串表示部署成功。java
{ "name" : "node-1", "cluster_name" : "elasticsearch-application", "cluster_uuid" : "MUOnu8JbTTe7bT1ru3Vb7Q", "version" : { "number" : "7.5.1", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96", "build_date" : "2019-12-16T22:57:37.835892Z", "build_snapshot" : false, "lucene_version" : "8.3.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }
path追加:C:\Program Files\nodejs\;
connect: { server: { options: { hostname:"*", port: 9100, base: '.', keepalive: true } } }
server.port: 9101 server.host: "0.0.0.0" elasticsearch.hosts: ["http://192.168.3.41:9200"]
input { beats { port => 5044 } } output { elasticsearch { hosts => ["http://192.168.3.41:9200"] index => "log-%{+YYYY.MM.dd}" } }
複製logstash-sample.conf至bin根目錄下,執行命令:logstash -f logstash-sample.conf --config.reload.automaticnode
在kibana->Disconver中建立日誌索引git