Advertisement
thanh_thu

OpenStack with ELK (Logstash)

Jun 19th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. => logstash sẽ theo dõi file trong /var/log/keystone/keystone-all.log và sẽ áp dụng các tag keystone, oslofmt và keysoneapi trong từng mục của log và các định nó là một loại keysyone.
  2.  
  3. file {
  4. path => [‘/var/log/keystone/keystone-all.log’]
  5. tags => [‘keystone’, ‘oslofmt’, ‘keystoneapi’]
  6. type => “keystone”
  7. }
  8.  
  9. => Một số thao tác định hình bản ghi để nắm rõ hơn về thông tin
  10.  
  11. if “keystoneapi” in [tags] {
  12. mutate {
  13. gsub => [‘logmessage’,”””,””]
  14. }
  15. grok {
  16. match => { “logmessage” => “[-] %{NOTSPACE:requesterip} – – [%{NOTSPACE:req_date} %{NOTSPACE:req_time}] %{NOTSPACE:method} %{NOTSPACE:url_path} %{NOTSPACE:http_ver} %{NUMBER:response} %{NUMBER:bytes} %{NUMBER:seconds}” }
  17. add_field => [“api”, “keystone”]
  18. add_tag => [“apimetrics”]
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement