# Use converted timestamp from csv like index sufix

**URL:** <https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308>\
**Category:** Logstash\
**Created:** [October 21, 2021, 11:13am UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308 "2021-10-21T11:13:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Nikolaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_nikolaev/32/80704_2.png) [@Alexey\_Nikolaev](https://discuss.elastic.co/u/Alexey_Nikolaev)\
**Post date:** [October 21, 2021, 11:13am UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/1 "2021-10-21T11:13:13Z")

</div>

Hello!  
I have a lot of CISCO CDR files, about 500k. Its logs from clustef of CISCO CUCM, and I want to put it to indexes with name CUCM-CDR-{mm-yyyy}. Date I want to get from field named "dateTimeDisconnect". Can you help me out?

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [October 21, 2021, 11:22am UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/2 "2021-10-21T11:22:12Z")

</div>

Can you give an example of what the field `dateTimeDisconnect` looks like?

---

<div class="post-metadata">

**Author:** ![Alexey\_Nikolaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_nikolaev/32/80704_2.png) [@Alexey\_Nikolaev](https://discuss.elastic.co/u/Alexey_Nikolaev)\
**Post date:** [October 21, 2021, 11:25am UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/3 "2021-10-21T11:25:37Z")

</div>

Here is - 1630999768

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [October 21, 2021, 11:41am UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/4 "2021-10-21T11:41:44Z")

</div>

```auto
input { generator { codec => json count => 1 lines => ['{ "dateTimeDisconnect": "1630999768" }'] } }
filter {
 date {
  match => ["dateTimeDisconnect", "UNIX"]
 }
}
output {
  elasticsearch {
    hosts => "localhost"
    index => "cucm-cdr-%{+MM-YYYY}"
  }
  stdout { codec => json }
}

```

Use date filter to convert field `dateTimeDisconnect` to a date and store in `@timestamp`. Then you can use the values in your index name. The `cucm-cdr` portion needs to be lowercased.

Index name will be `cucm-cdr-09-2021` from the conf above.

---

<div class="post-metadata">

**Author:** ![Alexey\_Nikolaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_nikolaev/32/80704_2.png) [@Alexey\_Nikolaev](https://discuss.elastic.co/u/Alexey_Nikolaev)\
**Post date:** [October 21, 2021, 12:13pm UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/5 "2021-10-21T12:13:14Z")

</div>

Thanks a lot!

---

<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:** [November 18, 2021, 12:13pm UTC](https://discuss.elastic.co/t/use-converted-timestamp-from-csv-like-index-sufix/287308/6 "2021-11-18T12:13:25Z")

</div>

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