i have single node ELK set up in 10.x.x.1 where i have installed logstash, elastic search and kibana.
i have my application running in another server 10.x.x.2 and i want my logs to be forwarded to elastic search.
My log file /var/log/myapp/myapp.log in 10.x.x.2
In 10.x.x.1 i provided this input in /etc/logstash/conf.d
input {
file {
path => "/var/log/myapp/myapp.log"
type => "syslog"
}
}
output {
elasticsearch {
hosts => ["10.252.30.11:9200"]
index => "versa"
}
}
My questions are as below
- Do i need to install logstash in 10.x.x.2
- How can i grep only for the lines having "Error"
- Everyday my app produces a log of size 10MB. i just want to know, if i can add one more node to my elastic search so that the space wont fill up.
- i dont want to keep my logs permanently in elastic search . Is there any way i can set an expiry time for the logs that am sending ? i.e. delete the logs after 7 days .
10.x.x.2and not on 10.x.x.1.