input { file { path => "/mnt/fileshare/logs/nginx-access.log" ## sample csv file start_position => "beginning" sincedb_path => "/dev/null" } } filter { grok { match => { "message" => ["%{IPORHOST:remote_ip} - %{DATA:user_name} \[%{HTTPDATE:access_time}\] \"%{WORD:http_method} %{DATA:url} HTTP/%{NUMBER:http_version}\" %{NUMBER:response_code} %{NUMBER:body_sent_bytes} \"%{DATA:referrer}\" \"%{DATA:agent}\""] } remove_field => "message" } mutate { add_field => { "read_timestamp" => "%{@timestamp}" } } date { match => [ "timestamp", "dd/MMM/YYYY:H:m:s Z" ] remove_field => "timestamp" } } output { stdout { codec => json_lines } elasticsearch { hosts => ["https://192.168.56.101:9200"] ## address of elasticsearch node index => "nginx-access" user => "elastic" password => "enter-password-here" ssl => true cacert => "/usr/share/ca-certificates/elastic-ca.crt" ## Shared Elasticsearch CA certificate path } }