Create Grafana table panel for monitor logs(Elasticsearch)
The table panel is very flexible, supporting both multiple modes for time series as well as for table, annotation and raw JSON data. It also provides date formatting and value formatting and coloring options.
By default, Grafana provides the logs panel to shows log lines from datasources. Using That log panel, it’s hard to identify what’s included in exact log point. Therefore I customized the Grafana table panel for visualize the logs.
To customize the table panel for logs do as follow.
- Navigate to Grafana Home page
- Choose visualization
2.1. Here, you can choose any kind of visualization type, such as graph, logs, table.In this case I’m choosing a table panel. You can customize your visualization type.
2.2. Choose your datasource
2.3. Choose “Raw document”. You can customize Size of the log points.
2.4. According to your regex on td-agent.conf you can add that column here, using Json table transform.(use Columns feature).
I’m using fluentd as a log shipping agent to elasticsearch. To learn HOW TO CONFIGURE FLUENTD TO MONITOR LOGS, click here.
2.5. By default, grafana provides “time, metric, value” as columns. You can also hide that columns as below.
2.6. Back to the dashboard and save the dashboard.
Additional
Explore logs
Explore allows you to dig deeper into your metrics and logs to find the cause. In here, admin can switch between metrics and logs by viewing them side-by-side. This creates a new debugging workflow.
Go to Explore and here choose your datasource at the top of the drop down. You can switch between Metrics and Logs.
Now you can see all the logs from time to time. You can also change the time duration and see oldest log
Template variables