Advertisement
phamthanhnhan14

log

Jun 7th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. [root@lab10 ~]# cat /xserver/elk_stack/logstash/config/log.conf
  2. input {
  3. file {
  4. path => "/var/log/httpd/*_log"
  5. start_position => "beginning"
  6. }
  7. }
  8. filter {
  9. if [path] =~ "access" {
  10. mutate { replace => { type => "apache_access" } }
  11. grok {
  12. match => { "message" => "%{COMBINEDAPACHELOG}" }
  13. }
  14. date {
  15. match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
  16. }
  17. } else if [path] =~ "error" {
  18. mutate { replace => { type => "apache_error" } }
  19. } else {
  20. mutate { replace => { type => "random_logs" } }
  21. }
  22. }
  23. output {
  24. elasticsearch {
  25. hosts => ["localhost:9200"]
  26. user => "elastic"
  27. password => "123456"
  28. manage_template => false
  29. #index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
  30. #document_type => "%{[@metadata][type]}"
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement