# Make Elasticsearch understand date/time field Nginx/apache logs

**URL:** https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968
**Category:** Elasticsearch
**Created:** [January 14, 2020, 9:33am UTC](https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968 "2020-01-14T09:33:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![spacecabbie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spacecabbie/32/60762_2.png) [@spacecabbie](https://discuss.elastic.co/u/spacecabbie)
#### Post date: [January 14, 2020, 9:33am UTC](https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968/1 "2020-01-14T09:33:34Z")

</div>

I am sending my logs from apache and nginx to elasticsearch via rsyslog.

Parsing to json:

```
version=2
rule=:%remote_addr:word% %ident:word% %auth:word% [%@timestamp:char-to:]%] "%method:word% %request:word% HTTP/%httpversion:float%" %status:number% %requesttime:float% "%referrer:char-to:"%" "%agent:char-to:"%"

```

.

```
template(name="apache-nginx" type="list"){
  property(name="$!all-json")
}

```

The problem is nginx logs like: [14/Jan/2020:08:48:23 +0100] so when send to elastic search it does not recognise it as date/time

Any tips tricks to fix it ? (no filebeats.) Has to be done with rsyslog/elasticsearch.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [January 14, 2020, 4:44pm UTC](https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968/2 "2020-01-14T16:44:18Z")

</div>

You can use an ingest pipeline so parse this as a proper date. Check out the [ingest node](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/ingest.html) in general, and the [grok processor](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/grok-processor.html) specifically, which also has predefined patterns for apache logs, that you might be able to reuse.

--Alex

---

<div class="post-metadata">

### Author: ![spacecabbie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spacecabbie/32/60762_2.png) [@spacecabbie](https://discuss.elastic.co/u/spacecabbie)
#### Post date: [January 19, 2020, 2:57pm UTC](https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968/3 "2020-01-19T14:57:50Z")

</div>

Ty ! love the flexibilityof the system but i'll have to study it more thanks for pointing me into correct direction.

For now i made all json template to import everything from rsyslog downside is can't use the premade dashboard oh wel all in time.

---

<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: [February 16, 2020, 2:58pm UTC](https://discuss.elastic.co/t/make-elasticsearch-understand-date-time-field-nginx-apache-logs/214968/4 "2020-02-16T14:58:09Z")

</div>

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