I am bringing the data thru webhook into logstash but can i please know how the parse that data and send it to separate index. I have provided the http://logstashIp/_hooks/gitlab in the gitlab webhook section which is sending the data to logstash and when i start the log stash with below comment i could see the data.
Use the filter between input and output block to parse the data and in output section use the Elasticsearch output to send the data to an index in ES. i would say use a logstash config file to write your configuration and run your logstash with below command.
Thank you for the reply. I see the below JSON data in logstash when I start the logstash in rubydebug .. I am trying to extract specific field from JSON data like timestamp, email, URL and send this extracted data to an index called "webhook_git".Can you please help with input.conf (i think i have to mention json codec) , filter.conf, output.conf .
JSON is a string representation of structured data. What you see here is structured data. There's nothing to extract. What you have can be sent straight to ES. If you don't want the fields to be nested under head_commit you can use a mutate filter's rename option to move the fields to the top level, i.e. rename [head_commit][timestamp] to timestamp and so on.
Generally , logtype is used in output.conf to send specific data to elastic search index -but how to configure JSON data in output.conf. Is the below configuration is correct ?
if [fields][logtype] == "json" {
elasticsearch {
hosts => ["https://15.1.200.31:9200","https://15.1.199.32:9200"]
manage_template => false
user => 'logstash_internal'
password => 'xxxxxxxxxxxx'
index => "webhook_json-%{+YYYY.MM}"
In filter.conf, can i please know what is the use of source , target ?
Thank you for the reply.. What i am trying to understand is how to write the inputs.conf , filter.conf for the JSON data coming from webhook. Like from below example, how can we write the configuration for JSON data from webhook and how to refer the JSON data in filter.conf ?
My question is how to write inputs , filters , outputs for the above JSON data that is coming from webhook. Generally, i use logtype field to refer data in filter.conf and output.conf. Since this data is directly coming from webhook , i don't know how to refer the data.
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.