12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/dispatch.comsunny.com*.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/www.comsunny.com_*.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/www.*.com.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/api.comsunny.com_443.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/internal.comsunny.com_80.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "nginx_access_log"
- path => "/usr/local/openresty/nginx/logs/uu.taschy.com.access.log"
- start_position => "beginning"
- }
- }
- input {
- file {
- type => "backend_log"
- path => "/var/prog/backend/logs/backend.log"
- start_position => "beginning"
- }
- }
- filter {
- if [type] == "nginx_access_log" {
- grok {
- patterns_dir => "/opt/logstash/logstash-6.0.0/patterns/nginx"
- match => { "message" => "%{NGINX_ACCESS}" }
- }
- }
- }
- filter {
- if [type] == "backend_log" {
- grok {
- patterns_dir => "/opt/logstash/logstash-6.0.0/patterns/backend.conf"
- match => { "message" => "%{BACKEND_LOG}" }
- }
- }
- }
- output {
- if [type] == "nginx_access_log" {
- elasticsearch {
- hosts => ["10.31.88.120:9200"]
- index => "nginx_access_log-%{+YYYY-MM-dd}"
- }
- }
- }
- output {
- if [type] == "backend_log" {
- elasticsearch {
- hosts => ["10.31.88.120:9200"]
- index => "backend_log-%{+YYYY-MM-dd}"
- }
- }
- }
|