Metricbeat is a useful tool that enables us to get data from more than one data source and load ready dashboards or to create dashboards by writing sql queries.
In our previous article, we created a PostgreSQL dashboard with Metricbeat. You can access the related article from the link below.
For those who will get data from MSSQL for the first time, you need to install Metricbeat first. You can use the link below for this.
We assume that Metricbeat has been installed and proceed. First, we enable the MSSQL module as follows.
metricbeat modules enable mssql
After enabling the module, we make the necessary changes in the mssql.yml file specified in the following directory for connection with MSSQL.
We change the inside of the yml as above. Let’s explain the above parameters:
metricsets: “transaction_log” and “performance” parameters are metrics to be taken from the sql server.
hosts: sql server ip and port information
username: sql server user
password: the password of the sql server user
period: How often the metrics will be taken.
After setting these parameters, we complete the metricbeat setup with the help of the following command and restart the service.
systemctl restart metricbeat.service
After restarting our service, our data is started to be transferred to Elasticsearch with the help of metricbeat.
Let’s check if we can see the data we sent to elasticsearch with ready dashboards on Kibana.
First, we go to the Dashboards section from the top left menu as seen in the screenshot below.
We write MSSQL in the search section in the dashboards section and below dashboards are listed.
It pulled the data according to the mssql.yml file. First, let’s choose the [Metricbeat MSSQL] Transaction Log ECS dashboard.
Our data has started to be transferred. Let’s take a look at our next dashboard.
Since it is in my local, there is not much data, but if you try on a production system, of course the graphics will look better. 🙂