How to make filter in beat on the logstash

Hi, I need to create a filter to avoid duplicating the information that I have from one index to another, in the configuration of the logstash file where the data of the first index that I upload to elastic are, I already made a filter that goes to snmp logstash, but in the other logstash file where the heartbeat data is uploaded to elastic, this in the logstash configuration is in beats, I tried to make a filter for that case but it does not work, I still get the data from the other index to that one, here I show you the index that is uploading data from snmp to the heartbeat index:


where the red circle is the snmp data that is appearing in my heartbeat data index.

input {
  beats {
    port => 5022
#    add_field => {ping-distrital => "uptime" }
  }
}

filter {
mutate {
   add_field => { "Tipo" => "Ping" }
 }
}

output {
if [Tipo] == "Ping" {
#  stdout{ }
  elasticsearch {
    hosts => ["https://xxxxxxxxxxxxxxxxus-central1.gcp.cloud.es.io:9243"]
    user => "elastic"
    password => "xxxxxxxxxxxxxxx"
    index => "agenteallot"
    }
  }
}

here I show you the configuration that I have of beats in logstash, where it passes me the heartbeat data through logstash and uploads them to elastic. I look forward to your help and cooperation with this, thanks you... :slight_smile:

I didn't understand your question quite clearly.

you are saying you are getting data from one logstash to this index agenteallot
and also getting data from another logstash config to this index agenteallot?

no, i mean that from logstash i get the data from heartbeat, logstash only uploads it to an index in kibana. so i need help to make a filter.

still please explain
heartbeat sends data to logstash and logstash creates two entry?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.