Hi Mitchell - Your guide on getting ELK setup was perfect. Worked like a charm. What do I do if I want to import previous log files (e.g., maillog-date or maillog.processed.x.gz)?
Also, I would like to import NGINX or HTTPD logs. is there a specific formula that I need to use to import and parse them?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey!
I’m not @manicas, but hopefully I can help! First of all, I’d suggest you take a look at the second part of his series: Adding Logstash Filters To Improve Centralized Logging It specifically covers Nginx and Apache logs.
Generally, there are two main pieces to getting a log from the server being monitored to the ELK server. Using Nginx as an example, you need to add a new entry to the the “files” section of /etc/logstash-forwarder
,
{
"paths": [
"/var/log/nginx/access.log"
],
"fields": { "type": "nginx-access" }
}
This tells the logstash-forwarder to send /var/log/nginx/access.log to the ELK instance.
One the other end, you’d need to create a filter telling logstash how to parse the file. The tutorial give an example.
This site can come in very useful when writing filters: https://grokdebug.herokuapp.com/
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.