Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@lab10 ~]# cat /xserver/elk_stack/logstash/config/log.conf
- input {
- file {
- path => "/var/log/httpd/*_log"
- start_position => "beginning"
- }
- }
- filter {
- if [path] =~ "access" {
- mutate { replace => { type => "apache_access" } }
- grok {
- match => { "message" => "%{COMBINEDAPACHELOG}" }
- }
- date {
- match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
- }
- } else if [path] =~ "error" {
- mutate { replace => { type => "apache_error" } }
- } else {
- mutate { replace => { type => "random_logs" } }
- }
- }
- output {
- elasticsearch {
- hosts => ["localhost:9200"]
- user => "elastic"
- password => "123456"
- manage_template => false
- #index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
- #document_type => "%{[@metadata][type]}"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement