I want to analyze AWS ELB logs, and I need to grep "instance" word from URL into a separate field, could you please provide an example, how to do it in filter section in logstash. Thanks
Notice, that if I copied one field to another, and than split and add new field - it it does't work: mutate { copy => {"request" => "request_split"} split => {"request_split" => "/"} add_field => { "instance" => "%{request_split[3]}" } }
but if I split and add new field without copiying, it works! mutate { split => {"request" => "/"} add_field => { "instance" => "%{request[3]}" } }
The idea is to take value from URL https://cloude.company.com:443/**instance**/Web/Services/Service.html
Filter that value, and add it into a field, and build all visualization based on that field. Will named that field as instance as an example.
This is my ELB LOG: h2 2019-05-09T23:55:51.100101Z elb_name 100.100.100.10:59907 192.168.1.10:443 0.007 0.088 0.000 200 200 1474 36394 "POST https://cloude-company.com:443/instance/Web/HomePage/Widget/Data HTTP/2.0" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 arn:aws:elasticloadbalancing:eu-west-1:100101001010:targetgroup/cloude/aa1001010010100a "Root=1-5cd4be07-1001010010100101001010010" "cloude.company.com" "session-reused" 8 2019-05-09T23:55:51.160000Z "forward" "-" "-"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.