27
loading...
This website collects cookies to deliver better user experience
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install logstash
input {
tcp {
port => 12345
codec => json
}
}
output { stdout { codec => rubydebug } }
filter {
split {
field => "message"
}
mutate {
add_field => { "cluster_id" => "JENKINS-LOGSTASH" }
add_field => { "namespace" => "jenkins-ci-cd-1" }
add_field => { "application" => "%{[data][fullProjectName]}" }
add_field => { "proc_id" => "%{[data][displayName]}" }
}
ruby {
path => "/home/yourpath/flattenJSON.rb"
script_params => { "field" => "data" }
}
}
output {
http {
url => "http://<logiq-instance>/v1/json_batch"
http_method => "post"
format => "json_batch"
content_type => "application/json"
pool_max => 300
pool_max_per_route => 100
}
}
/usr/share/logstash
) and pass the custom configuration file we prepared above using the following command:/usr/share/logstash# bin/logstash -f /etc/logstash/logstash-sample.conf