# How to calculate a monthly availability of my website?

**URL:** <https://discuss.elastic.co/t/how-to-calculate-a-monthly-availability-of-my-website/108735>\
**Category:** Elasticsearch\
**Created:** [November 22, 2017, 2:58pm UTC](https://discuss.elastic.co/t/how-to-calculate-a-monthly-availability-of-my-website/108735 "2017-11-22T14:58:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OucemaBellagha](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@OucemaBellagha](https://discuss.elastic.co/u/OucemaBellagha)\
**Post date:** [November 22, 2017, 2:58pm UTC](https://discuss.elastic.co/t/how-to-calculate-a-monthly-availability-of-my-website/108735/1 "2017-11-22T14:58:49Z")

</div>

Greetings,

I have the following index populated each 3 minutes:

```
{
  "template": "web-*",
  "settings": {
    "number_of_shards": 1
  },
  "mappings": {
      "web-": {
      "_source": {
      "enabled": true
      },
      "properties": {
        "@timestamp": {
          "type": "date",
          "format" : "epoch_second"
        },
        "uri": {
          "type": "keyword"
        },
        "http_status": {
          "type": "integer"
        },
        "downtime": {
          "type": "integer"
        }
      }
    }
  }
}

```

Now the variable "downtime" will be equal to 3 (minutes) if "http\_status" is different than 200.

I want to calculate based on "time" and "downtime" the availability percentage of my web each month for example:  
"total downtime for this month" = 200 min --\> how can I get this value each month?  
"time in minutes of this month" = 44640 min

availability percentage by month = (200 / 44640 ) \* 100

Now how can I get the availability percentage automatically calculated and want to report it by the end of each month?

---

<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:** [December 20, 2017, 2:59pm UTC](https://discuss.elastic.co/t/how-to-calculate-a-monthly-availability-of-my-website/108735/2 "2017-12-20T14:59:18Z")

</div>

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