# Using grok to extract android log data

**URL:** <https://discuss.elastic.co/t/using-grok-to-extract-android-log-data/196904>\
**Category:** Logstash\
**Created:** [August 27, 2019, 8:39am UTC](https://discuss.elastic.co/t/using-grok-to-extract-android-log-data/196904 "2019-08-27T08:39:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alisa\_Faingold](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alisa_faingold/32/45836_2.png) [@Alisa\_Faingold](https://discuss.elastic.co/u/Alisa_Faingold)\
**Post date:** [August 27, 2019, 8:39am UTC](https://discuss.elastic.co/t/using-grok-to-extract-android-log-data/196904/1 "2019-08-27T08:39:18Z")

</div>

Hi all, I'm a new user in ELK and logstash, and I'm trying to extract the following log with grok but without success for now.

This is my log:  
08-14 10:22:50.863 1419 1419 D GpsNetInitiatedHandler: location enabled :false

and I wish to extract this like that:

- timestamp: 08-14 10:22:50.863
- not important 1: 1419
- not important 2: 1419
- log-level: D
- message: GpsNetInitiatedHandler: location enabled :false

Thank you!

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 27, 2019, 12:51pm UTC](https://discuss.elastic.co/t/using-grok-to-extract-android-log-data/196904/2 "2019-08-27T12:51:23Z")

</div>

I would use dissect for that

```
    dissect { mapping => { "message" => "%{[@metadata][timestamp]} %{+[@metadata][timestamp]} %{} %{} %{loglevel} %{msg}" } }
    date { match => ["[@metadata][timestamp]", "MM-dd HH:mm:ss.SSS" ] }

```

Since your timestamp does not contain a year logstash will guess which year it should use and you will almost certainly dislike the results sometimes.

---

<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:** [September 24, 2019, 12:55pm UTC](https://discuss.elastic.co/t/using-grok-to-extract-android-log-data/196904/3 "2019-09-24T12:55:52Z")

</div>

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