# Don't get doc count after setting ilm

**URL:** <https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 12, 2021, 11:31am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117 "2021-02-12T11:31:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [February 12, 2021, 11:31am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/1 "2021-02-12T11:31:56Z")

</div>

I am using two indices each index is pointed to ilm.  
below is the index setting for two indices

```auto
 "index": {
    "lifecycle": {
      "name": "packetbeat_flow",
      "rollover_alias": "log-pb-flow"
    },
    "number_of_shards": "1",
    "number_of_replicas": "1"
  }

```

```auto
 "index": {
    "lifecycle": {
      "name": "packetbeat_dns",
      "rollover_alias": "log-pb-dns"
    },
    "number_of_shards": "1",
    "number_of_replicas": "1"
  }

```

ILM Policy for packetbeat\_flow

```auto
PUT _ilm/policy/packetbeat_flow
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "30d",
            "max_size": "50gb"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "2d",
        "actions": {
          "set_priority": {
            "priority": 50
          },
          "shrink": {
            "number_of_shards": 1
          },
          "allocate": {
            "require": {
              "data": "warm"
            },
            "number_of_replicas": 1
          }
        }
      },
      "delete": {
        "min_age": "30d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}

```

ILM Policy for packetbeat\_dns

```auto
PUT _ilm/policy/packetbeat_dns
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "30d",
            "max_size": "50gb"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "2d",
        "actions": {
          "set_priority": {
            "priority": 50
          }
        }
      },
      "delete": {
        "min_age": "30d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}

```

In logstash pipeline file

```auto
output {
 if[agent][type]=="packetbeat"
 {
if[type]=="flow"
   {
    elasticsearch {
    hosts => ["http://em1:9200","http://em2:9200"]
    manage_template => false
    ilm_rollover_alias => "log-pb-flow"
    ilm_pattern => "000001"
    ilm_policy => "packetbeat_flow"
  }
  }

if[type]=="dns"
   {
    elasticsearch {
    hosts => ["http://em1:9200","http://em2:9200"]
    manage_template => false
    ilm_rollover_alias => "log-pb-dns"
    ilm_pattern => "000001"
    ilm_policy => "packetbeat_dns"
  }
  }

}
}

```

In elasticsearch log file

```auto
[2021-02-12T16:03:04,567][INFO][o.e.x.i.IndexLifecycleTransition] [em2] moving index [log-pb-flow-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-index-color"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [packetbeat_flow]
[2021-02-12T16:03:04,594][INFO][o.e.x.i.IndexLifecycleTransition] [em2] moving index [log-pb-dns-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-index-color"}] to [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}] in policy [packetbeat_dns]

```

i am not getting any data the doc count is 0

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 14, 2021, 11:07pm UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/2 "2021-02-14T23:07:12Z")

</div>

What's the output from `_cat/indices?v`.

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [February 15, 2021, 3:16am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/3 "2021-02-15T03:16:29Z")

</div>

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open log-pb-flow-000001 maExfsMhS_aDv94iLJZcIA 1 2 0 0 624b 208b
green open .apm-agent-configuration zlDBqb8oQ7ae0Gw-vDVOPQ 1 1 0 0 416b 208b
green open .kibana_2 lXIoyQ2qS0iNugyjnIXNMw 1 1 114 16 4.3mb 2.1mb
green open .kibana_1 c1MPSH3hQMmpPCM_Oa_wGg 1 1 19 0 4.2mb 2.1mb
green open .monitoring-kibana-7-2021.02.11 bJFTt3-4SI6iHohNhlqPZQ 1 1 28 0 211.1kb 90kb
green open .monitoring-kibana-7-mb-2021.02.11 2JCoYiwjQu2wwv9yLm-ZLg 1 1 6736 0 2.8mb 1.4mb
green open .kibana-event-log-7.11.0-000001 GCcuHOSFSfaiDfRK_vQH4Q 1 1 1 0 11.2kb 5.6kb
green open .monitoring-logstash-7-mb-2021.02.12 Q2blipw0TduR_Skp7LIT7g 1 1 4830 0 1.3mb 613.4kb
green open .monitoring-logstash-7-mb-2021.02.14 Aw7TzjcqRom9kSGS_QcEBg 1 1 25742 0 4.6mb 2.3mb
green open .monitoring-es-7-mb-2021.02.12 1ej1h66GQPucFab-uu60Rg 1 1 249819 0 388.9mb 193.3mb
green open .apm-custom-link shLfP5DIR-eOJmEvovTDtw 1 1 0 0 416b 208b
green open metricbeat-7.11.0-2021.02.11-000001 23neCPLmTgOC1edGdMzUbg 1 1 63 0 255.9kb 128kb
green open .kibana_task_manager_1 el_Z2YB_QGiScTUtbr7fxQ 1 1 8 353129 220.4mb 110.3mb
green open .monitoring-es-7-mb-2021.02.13 7zqFQrgxRLqLoduaiCiUEw 1 1 276558 0 439.9mb 220.5mb
green open .monitoring-es-7-mb-2021.02.11 RZ4QiZgTRqi-PdGe5lGd-A 1 1 84659 0 127.8mb 64mb
green open .monitoring-es-7-mb-2021.02.14 8Rs6P4lFQ0eASQlGE3aRPQ 1 1 302645 0 468.9mb 234.9mb
green open .monitoring-es-7-mb-2021.02.15 xG5VNGpKQt2MZ6dRaAlsNw 1 1 43344 0 70.6mb 35.2mb
green open .monitoring-kibana-7-mb-2021.02.15 RfFvQdgGRe6ObQBJRmmUqw 1 1 2346 0 954.5kb 517.2kb
green open .monitoring-kibana-7-mb-2021.02.14 k9u5_8WYS8KLL38fW4oBwg 1 1 17280 0 6.9mb 3.4mb
green open .kibana-event-log-7.10.2-000001 TpCUELDLQIqC5qh8GG-dCw 1 1 1 0 11.2kb 5.6kb
green open .monitoring-es-7-2021.02.11 2O8dJMB8Sq-9xErk-8HrhA 1 1 29 0 322.3kb 206kb
green open .monitoring-kibana-7-mb-2021.02.13 sJ82zqbaRDSoekR9E6Nwuw 1 1 17280 0 6.4mb 3.2mb
green open .monitoring-kibana-7-mb-2021.02.12 dzBqtjsGSCG2Jw9y-KlHiA 1 1 17280 0 6.6mb 3.3mb

```

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [February 15, 2021, 7:06am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/4 "2021-02-15T07:06:19Z")

</div>

Hey @warkolm i am using one index for make it simple.Index is created but the doc count is 0

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [February 16, 2021, 9:02am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/5 "2021-02-16T09:02:27Z")

</div>

The problem is not solved index is created no data is coming.

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [February 17, 2021, 10:25am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/6 "2021-02-17T10:25:06Z")

</div>

The problem is solved it was **packetbeat** issue

---

<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:** [March 17, 2021, 10:25am UTC](https://discuss.elastic.co/t/dont-get-doc-count-after-setting-ilm/264117/7 "2021-03-17T10:25:23Z")

</div>

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