# Varnish Metrics with Metricbeat:

**URL:** <https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921>\
**Category:** Kibana\
**Tags:** elastic-stack-monitoring\
**Created:** [September 13, 2023, 8:12am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921 "2023-09-13T08:12:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepika\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deepika_gupta/32/123300_2.png) [@Deepika\_Gupta](https://discuss.elastic.co/u/Deepika_Gupta)\
**Post date:** [September 13, 2023, 8:12am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/1 "2023-09-13T08:12:04Z")

</div>

Hello Team,

Greetings!  
I want to use Metricbeat, part of the Elastic Stack, to collect and monitor Varnish metrics. Metricbeat's Varnish module allows to gather information about cache hits, cache misses, cache size, and more.

How can I visualize these metrics in Kibana?

Kindly elaborate on the steps so I can implement the same.

I have tried the below steps which are not working for me as expected(kibana is not tracking varnish.

1-sudo yum install metricbeat  
2-sudo systemctl start metricbeat  
sudo systemctl enable metricbeat  
3- sudo vi /etc/metricbeat/modules/varnish.yml  
metricbeat.modules:

- module: varnish  
metricsets: ["varnish"]  
enabled: true  
period: 10s  
hosts: ["[http://localhost:6082](http://localhost:6082)"]  
4- sudo systemctl restart metricbeat

Regards,  
Deepika

---

<div class="post-metadata">

**Author:** ![raavikant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raavikant/32/125601_2.png) [@raavikant](https://discuss.elastic.co/u/raavikant)\
**Post date:** [September 13, 2023, 9:29am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/2 "2023-09-13T09:29:09Z")

</div>

Hi Deepika,

I don't have that much knowledge but still, I will try to solve your query-

So deepika, to visualize Varnish metrics collected by Metricbeat in Kibana, you can go through these 4 steps:

Install Metricbeat: You must ensure that Metricbeat is correctly installed on your system. You've already done this with the command `sudo yum install metricbeat` . Confirm it's running using `sudo systemctl status metricbeat` .

Configure Varnish Module: Open the Varnish module configuration file with the command:

`sudo vi /etc/metricbeat/modules.d/varnish.yml`

Ensure your configuration file looks similar to the following (modify as needed):

YAML

```auto
- module: varnish
  metricsets: ["varnish"]
  enabled: true
  period: 10s
  hosts: ["http://localhost:6082"]

```

Restart Metricbeat: After editing the configuration, restart Metricbeat to apply the changes:

`sudo systemctl restart metricbeat`

Kibana Configuration:

Open Kibana in your web browser.  
Go to the "Management" section.  
Click on "Index Patterns" and create a new index pattern for Metricbeat indices. Usually, the Metricbeat indices start with `metricbeat-`.  
Define the time field for indexing, which is typically `@timestamp`.

Thanks

---

<div class="post-metadata">

**Author:** ![Deepika\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deepika_gupta/32/123300_2.png) [@Deepika\_Gupta](https://discuss.elastic.co/u/Deepika_Gupta)\
**Post date:** [September 13, 2023, 11:37am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/3 "2023-09-13T11:37:57Z")

</div>

Hi RaaviKant,

Thanks for your reply.

If you look at my query, I have already done those steps but still, Kibana is not monitoring.

However, after those steps, I restarted Metricbeat and checked on Kibana(same steps that you mentioned as well) but unfortunately, Kibana is not monitoring.

Any clue?

Regards,  
Deepika

---

<div class="post-metadata">

**Author:** ![raavikant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raavikant/32/125601_2.png) [@raavikant](https://discuss.elastic.co/u/raavikant)\
**Post date:** [September 13, 2023, 1:54pm UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/4 "2023-09-13T13:54:39Z")

</div>

Wait, let me look into this.

---

<div class="post-metadata">

**Author:** ![Deepika\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deepika_gupta/32/123300_2.png) [@Deepika\_Gupta](https://discuss.elastic.co/u/Deepika_Gupta)\
**Post date:** [September 13, 2023, 2:10pm UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/5 "2023-09-13T14:10:45Z")

</div>

Appreciate your help!

Regards,  
Deepika

---

<div class="post-metadata">

**Author:** ![Deepika\_Gupta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deepika_gupta/32/123300_2.png) [@Deepika\_Gupta](https://discuss.elastic.co/u/Deepika_Gupta)\
**Post date:** [September 18, 2023, 9:02am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/6 "2023-09-18T09:02:33Z")

</div>

Hello team,

any guidance on this?

Regards,  
Deepika

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 16, 2023, 9:02am UTC](https://discuss.elastic.co/t/varnish-metrics-with-metricbeat/342921/7 "2023-10-16T09:02:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
