Guest User

Untitled

a guest
Aug 30th, 2020
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. input{
  2. beats{
  3. port => 5044
  4. ssl => true
  5. ssl_certificate_authorities => ["/etc/elk/certs/ca/ca.crt"]
  6. ssl_certificate => "/etc/elk/instances/instances.crt"
  7. ssl_key => "/etc/elk/instances/logs.pkcs8.key"
  8. ssl_key_passphrase => "password"
  9. ssl_verify_mode => "force_peer"
  10. }
  11. }
  12. filter {
  13. mutate {
  14. add_tag => [ "insidefilter" ]
  15. }
  16. if [log][file][path] =~ "mongos.log"{
  17. grok { match => { "message" => "\A%{TIMESTAMP_ISO8601} I ACCESS %{NOTSPACE} SCRAM-SHA-1 authentication failed for %{USER:User} on %{USER:DB} from client %{SYSLOGHOST:From}:%{INT:Port} ; %{GREEDYDATA:Reason}"
  18. }
  19. }
  20. mutate { add_tag => [ "mongosIfStatement" ] }
  21. }
  22. if [log][file][path] =~ "mysql.*\.log$" {
  23. grok { match => { "message" => "%{TIMESTAMP_ISO8601:Date} %{INT:Number} \[Note] Access denied for user '%{USER:User}'@'%{SYSLOGHOST:IP}' \(using password: %{WORD:Password}%{GREEDYDATA}"
  24. }
  25. }
  26. mutate { add_tag => [ "mysqldIfStatement" ] }
  27. }
  28. if [log][file][path] =~ /\.json$/ {
  29. json {
  30. source => "message"
  31. }
  32. }
  33. if [log][file][path] =~ "commands.log" {
  34. grok{
  35. #match => { "message" => "\A%{SYSLOGTIMESTAMP:sys_timestamp} %{NOTSPACE:Hostname} %{USER:Logged}: USER=%{USER:User} PWD=%{UNIXPATH:Directory} PID=\[%{INT:PID}] CMD="%{DATA:Command}" Exit=\[%{INT:Exit}\] CONNECTION=%{GREEDYDATA:Connection}"
  36. #}
  37. match => { "message" => ["\[(%{TIMESTAMP_ISO8601:sys_timestamp})\]\s(?<Hostname>[0-9a-zA-Z_-]+)\s(?<Logged>[0-9a-zA-Z_-]+)\:USER=(?<User>[0-9a-zA-Z_-]+)\sPWD=(?<Directory>[0-9a-zA-Z_/-]+)\sPID=\[(?<PID>[0-9]+)\]\sCMD=\"(?<Command>.*)\"\sExit=\[(?<Exit>[0-9]+)\]\sCONNECTION=(?<Connetion>.*)", "\A%{SYSLOGTIMESTAMP:sys_timestamp} %{NOTSPACE:Hostname} %{USER:Logged}: USER=%{USER:User} PWD=%{UNIXPATH:Directory} PID=\[%{INT:PID}] CMD=%{QUOTEDSTRING:Command} Exit=\[%{INT:Exit}] CONNECTION=%{GREEDYDATA:Connection}"]
  38. }
  39. match => { "message" => "\A%{SYSLOGTIMESTAMP:sys_timestamp} %{HOSTNAME:Hostname} %{USER:Logged}: USER=%{USER:User} PWD=%{UNIXPATH:Directory} PID=\[%{INT:PID}] CMD=%{QUOTEDSTRING:Command} Exit=\[%{INT:Exit}] CONNECTION=%{GREEDYDATA:Connection}"}
  40. }
  41. }
  42. }
  43. output{
  44. elasticsearch {
  45. # manage_template => false
  46. hosts => ["https://localhost:9200"]
  47. cacert => "/etc/elasticsearch/estackcap12extract.crt"
  48. ssl => true
  49. ssl_certificate_verification => false
  50. index => "%{[@metadata][beat]}-%{[@metadata][version]}"
  51. #index => "cleandata"
  52. user => "elastic"
  53. password => "password"
  54. }
  55. }
Add Comment
Please, Sign In to add comment