I am a new user to graylog open. I wanted to setup graylog to read server logs but I believe some link is missing in the setup. If anyone can help me setup the missing link.
Steps I followed till now:
- Installed elasticsearch as per installation instructions.
- Installed mongodb
- Installed graylog
- Installed graylog-sidecar
- Installed filebeat from elasticsearch
- Configured filebeat config
- Created token for sidecar via graylog web UI and configured it in sidecar configuration via command line
- Added filebeat collector with sidecar via graylog web UI
- Updated default filebeat output to point to elasticsearch ip/port
- Added input via web ui at system > inputs.
After all this setup, all things are up and running but no logs/messages are seen.
Pls help me with the missing pieces to step.
My server is a centos based server.
can you please post your config files?
PFA the configs:
input config via web ui
sidecar config via web UI
# Needed for Graylog
- input_type: log
filebeat.yml (minimised) via command line
- type: filestream
- add_cloud_metadata: null
- add_docker_metadata: null
- add_kubernetes_metadata: null
elasticsearch.yml (minimised) via command line
Pls specify if any other config is needed.
PS: I am using tomcat for my application so the log I want to read are generated at
/opt/tomcat/latest/logs/ folder which I have updated in the above config.
Just chiming in for sec, Graylog-sidecar is a wrapper for Winlogbeat, FileBeat, etc… you should not need to install FileBeat and the configurations for FileBeat would be done through the Web UI. Only thing you need to do is install graylog-sidecar , edit the sidecar.yaml file to connect to Graylog server and edit the FileBeat configuration on the Web UI.
Initially, I did what you suggested.
I installed graylog-sidecar and tried configuring the sidecar and filebeat. But I could not find filebeat installed. And I came across few article/blog/SO which suggested to install filebeat expliciltly as filebeat is no longer bundled with sidecar. I felt weird but then I did what I found on those articles.
Nonetheless, what do you suggest should I do now? Bcs at this point, I am clueless on how to proceed further.
I have some questions for you
a) if your clients are UNIX/Linux systems, why don’t you simply use rsyslog? it works out of the box, it’s pretty straightforward to configure and you don’t need to fiddle around with cumbersome filebeat options…
b) do you have a Graylog server ingesting logs from external clients/remove systems? In this sense, can you please describe your setup?
The current scene is we are using tomcat based application server and we dont have any centralised logging system. We only log to local log files. So everytime a issue comes up, the team needs to access the log files to debug issues and the access to log files are with very limited stakeholders. So the larger actual usecase for setting up GrayLog is to ingest our tomcat based application logs to Graylog so that the developers and testers dont need to fiddle thru the log files to debug issues.
So this setup is a POC and I am trying to make this work using the systemsLog or any logs available on server.
Once this setup works, we will be then pushing our development and staging server logs to this particular instance (both servers are on different machines).
Once we are good with the dev and staging server logs, we will also start pushing prod logs.
So rsyslog is not our target.
The graylog-sidecar is currently trying to ingest logs from the same machine using filebeat. No other input or external system is configure yet to send data to this instance of graylog. Once this primary testing of ingesting local logs works, will start ingesting logs from external system.
I hope above points make it clear what we are trying to setup.
Thanks for the description.
When comparing the configuration shown here Ingest from files - Log sources, the relevant part looks like this:
- input_type: log
but yours looks like this:
- input_type: log
What if you simply change your config to read:
and restart the service?
I tried the changes in the log path previous, and I re-tried updating the log paths after your reply but it still does not work.
My sidecar show the files correctly as it was showing previously by I dont find any messages in the main search screen.
I would look back over this documentation here. When your stuck or have issues its better to get advice here or support instead of a third party documentation.
Configure sidecar.yaml file
root@keycloak:/home/greg# cat /etc/graylog/sidecar/sidecar.yml | egrep -v "^\s*(#|$)"
NOTE For the server_api_token: you get that from Users & Teams section.
Graylog-sidecar is done.
The rest should be self-explanatory in the documents,
Click on configuration copy or modify FileBeat template and attach it to the host.
Don’t forget to check the logs.
I have already referred to the documentation link you shared.
And the necessary changes are also done to the
Required filebeat config is also configured as per the docs.
Token for sidecar config is also generated as per the steps mentioned in the docs.
Even after setting up all the config, and things didn’t worked, I had to referred to different blogs and third party articles.
[root@dev_server parth]# cat /etc/graylog/sidecar/sidecar.yml | egrep -v "^\s*(#|$)"
This is the output of my
PFA output of sidecar.log from
time="2022-12-02T19:18:55+05:30" level=info msg="Starting signal distributor"
time="2022-12-02T19:19:05+05:30" level=info msg="Adding process runner for: filebeat"
time="2022-12-02T19:19:05+05:30" level=info msg="[filebeat] Configuration change detected, rewriting configuration file."
time="2022-12-02T19:19:05+05:30" level=info msg="[filebeat] Starting (exec driver)"
time="2022-12-05T19:25:04+05:30" level=info msg="Stopping signal distributor"
time="2022-12-05T19:25:04+05:30" level=info msg="[filebeat] Stopping"
time="2022-12-05T19:25:16+05:30" level=info msg="Starting signal distributor"
time="2022-12-05T19:25:26+05:30" level=info msg="Adding process runner for: filebeat"
time="2022-12-05T19:25:26+05:30" level=info msg="[filebeat] Configuration change detected, rewriting configuration file."
time="2022-12-05T19:25:27+05:30" level=info msg="[filebeat] Starting (exec driver)"
/var/log/graylog-sidecar/filebeat_stderr.log file is empty and no error is recorded here.
That’s unfortunate and I understand.
On the dashboard you should be able to see the sidecar status Green/Running at this point, am I correct?
If this is correct then you should see the following.
NOTE: This section is where you create the template needed for attaching it to the sidecar.
I also see your using Localhost in the FileBeat configuration and using 127.0.0.1 in the sidecar configuration. You may want to adjust the FileBeat configurations to use the loopback address.
On Graylog Web UI you should have something like this.
I see the the FileBeat service has started. So perhaps check Firewall and/or Input used.
All items suggested by you are working fine.
And I also updated the filebeat config with 127.0.0.1 instead of localhost as per suggestion.
Due to forum restrictions,
unable to attach multiple screenshots so attaching links to the same and spliting this message in 2 parts
Inputs stream config
Sidecar config running green
continued in next message…
List of file in sidecar details (0 in/ 0 out also visible)
Filebeat attached to sidecar
Filebeat Config (updated with loopback address)
Pls check if any other discrepancies in this configs.
Should it be using the logstash output on 127.0.0.1:5044 as opposed to Elastic output on 9200?
The default was config was for logstash but I haven’t setup logstash.
And either way, even with the default logstash config initially, it did not worked.
And then I felt it should be updated from logstash to ES so I updated it to ES.
So I need to setup logstash as well?
Haven’t come across any instruction to setup up logstash so no idea on that.
Perhaps I’ve misunderstood here but in the current setup of your filebeat you are attempting to send logs to 127.0.0.1 on port 9200. I can see you have an input listening on port 5044 on Graylog which I assume you want logs to arrive on, filebeat should be pointed at this port in order to deliver logs.
I had previously tried to update the inputs with port no to 9200 but that input failed to start. Let me change the port in filebeat and check if that works.
I tried by changing the filebeat config to push log to 5400 but still all systems are ups without any positive reslults.
And ideally, bcs the ES is running at 9200, i believe 9200 should be the actual value.
So the issue still persist.
So you want to deliver these logs straight to Elasticsearch and not ingest via Graylog?