Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input{
- beats{
- port => 5044
- ssl => true
- ssl_certificate_authorities => ["/etc/elk/certs/ca/ca.crt"]
- ssl_certificate => "/etc/elk/instances/instances.crt"
- ssl_key => "/etc/elk/instances/logs.pkcs8.key"
- ssl_key_passphrase => "password"
- ssl_verify_mode => "force_peer"
- }
- }
- filter {
- mutate {
- add_tag => [ "insidefilter" ]
- }
- if [log][file][path] =~ "mongos.log"{
- 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}"
- }
- }
- mutate { add_tag => [ "mongosIfStatement" ] }
- }
- if [log][file][path] =~ "mysql.*\.log$" {
- grok { match => { "message" => "%{TIMESTAMP_ISO8601:Date} %{INT:Number} \[Note] Access denied for user '%{USER:User}'@'%{SYSLOGHOST:IP}' \(using password: %{WORD:Password}%{GREEDYDATA}"
- }
- }
- mutate { add_tag => [ "mysqldIfStatement" ] }
- }
- if [log][file][path] =~ /\.json$/ {
- json {
- source => "message"
- }
- }
- if [log][file][path] =~ "commands.log" {
- grok{
- #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}"
- #}
- 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}"]
- }
- 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}"}
- }
- }
- }
- output{
- elasticsearch {
- # manage_template => false
- hosts => ["https://localhost:9200"]
- cacert => "/etc/elasticsearch/estackcap12extract.crt"
- ssl => true
- ssl_certificate_verification => false
- index => "%{[@metadata][beat]}-%{[@metadata][version]}"
- #index => "cleandata"
- user => "elastic"
- password => "password"
- }
- }
Add Comment
Please, Sign In to add comment