# Timelion request error ---\> \[parsing exception\]

**URL:** <https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [October 29, 2019, 2:49pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695 "2019-10-29T14:49:30Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [October 29, 2019, 2:49pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/1 "2019-10-29T14:49:30Z")

</div>

Hi there,

I'm trying to visualize and compare a daily unique count of "player\_id" from 2 different indices (_session\_data_ and _gameplay\_stat_) using timelion.  
The request just for the first index vizualization looks like:  
`.es(interval=1d, index=session_data, metric=cardinality:player_id).label('Unique Players Logged')`

> **And there is nothing, just a legend label has changed**
>
> ![](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a881ba1cee6dae6ac71c154567054bec18722c2c.png)

Then I'm adding an expression for the 2nd index:  
`.es(index=gameplay_stat, metric=cardinality:game.player).label('Unique Players Played')`

> **and got 2 errors**
>
> ![](https://us1.discourse-cdn.com/elastic/original/3X/a/f/afa4617bc329e8d86a2a9720eac59280a9d46a48.png)

What's wrong with it?

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [October 29, 2019, 6:13pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/2 "2019-10-29T18:13:55Z")

</div>

It's hard to say without seeing the errors. It looks like they didn't post properly to Discuss. Could you repost them?

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [October 30, 2019, 7:57am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/3 "2019-10-30T07:57:29Z")

</div>

The errors screenshot is in "hidden details", so it is:  
 ![UPdsyqM](https://us1.discourse-cdn.com/elastic/original/3X/a/f/afa4617bc329e8d86a2a9720eac59280a9d46a48.png)

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [October 31, 2019, 8:41am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/4 "2019-10-31T08:41:43Z")

</div>

Did you put a comma between the two expressions? Testing locally

```auto
.es(interval=1d, index=session_data, metric=cardinality:player_id).label('Unique Players Logged') .es(index=gameplay_stat, metric=cardinality:game.player).label('Unique Players Played')

```

gave me the error you posted, but

```auto
.es(interval=1d, index=session_data, metric=cardinality:player_id).label('Unique Players Logged'), .es(index=gameplay_stat, metric=cardinality:game.player).label('Unique Players Played')

```

works fine for me.

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [October 31, 2019, 8:52am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/5 "2019-10-31T08:52:33Z")

</div>

> [@flash1293](#):
>
> works fine for me

I've just copied it, there were no any errors, but it has shown a zero-result (for 15 weeks!):

 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/0/9009be73c7c8a04b9fafd35398ca2005911a6b1f.png)

When the data is vizualized as metrics, everything works fine (the same result for 15 weeks):  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/e/dead609c641f89d4808f2dbaba8b7fb1d69bb584.png)

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [October 31, 2019, 1:26pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/6 "2019-10-31T13:26:17Z")

</div>

I'm just guessing, but is your index actually called `session_data` or should it be `session_data*` because there is some suffix (like the date) in the index name? Another reason could be the field names. If the `*` in the index name isn't the issue, could you paste the mapping of your indices and a few sample documents here?

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [October 31, 2019, 2:14pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/7 "2019-10-31T14:14:49Z")

</div>

Well, actually yesterday I've created an index pattern called "`session_data*`", but it's already deleted and is not used here, it's just a coincidence.

> **So, here is a JSON view of an element ("session\_data" index)**
>
> ```
> {
> "_index": "session_data",
> "_type": "data",
> "_id": "h9vmIW4BSOdvtuXlxyAc",
> "_version": 1,
> "_score": null,
> "_source": {
> "id": 27932,
> "player_id": 450,
> "player_login": "Bruno Buccelati",
> "ram_amount": "5634",
> "gpu_model": "Adreno (TM) 630",
> "cpu_model": "ARM64 FP ASIMD AES",
> "start_at": "2019-10-31T11:10:53.000+00:00",
> "end_at": "2019-10-31T11:35:45.000+00:00",
> "duration": 1492,
> "is_tester": true,
> "device": "Xiaomi POCOPHONE F1",
> "ip": "......"
> },
> "fields": {
> "end_at": [
> "2019-10-31T11:35:45.000Z"
> ],
> "start_at": [
> "2019-10-31T11:10:53.000Z"
> ],
> "day_of_month": [
> 31
> ],
> "hour_of_day": [
> 11
> ],
> "day_of_week": [
> 4
> ]
> },
> "sort": [
> 1572520253000
> ]
> }
> 
> ```

Its screenshot:

 ![](https://us1.discourse-cdn.com/elastic/original/3X/0/9/09c6cda185e49b77afe89f684788d33330905a6f.png)  
And some other elements of `session_data` index:

```
Oct 31, 2019 @ 13:48:22.000	id:27,949 player_id:474 player_login:Magore ram_amount:16313 gpu_model:Radeon (TM) RX 470 Graphics cpu_model:Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz start_at:Oct 31, 2019 @ 13:48:22.000 end_at:Oct 31, 2019 @ 13:50:12.000 duration:0:01:50 is_tester:true device:MS-7808 (MSI) ip:....... _id:ltvmIW4BSOdvtuXlyCCW _type:data _index:session_data _score: - day_of_month:31 hour_of_day:11 day_of_week:4

Oct 31, 2019 @ 13:47:41.000	id:27,948 player_id:474 player_login:Magore ram_amount:16313 gpu_model:Radeon (TM) RX 470 Graphics cpu_model:Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz start_at:Oct 31, 2019 @ 13:47:41.000 end_at:Oct 31, 2019 @ 13:50:13.000 duration:0:02:32 is_tester:true device:MS-7808 (MSI) ip:....... _id:ldvmIW4BSOdvtuXlyCCK _type:data _index:session_data _score: - day_of_month:31 hour_of_day:11 day_of_week:4

Oct 31, 2019 @ 13:47:15.000	id:27,947 player_id:446 player_login:HaxuJluBaIO ram_amount:5634 gpu_model:Adreno (TM) 630 cpu_model:ARM64 FP ASIMD AES start_at:Oct 31, 2019 @ 13:47:15.000 end_at:Oct 31, 2019 @ 13:54:18.000 duration:0:07:03 is_tester:true device:Xiaomi POCO F1 ip:........ _id:lNvmIW4BSOdvtuXlyCCB _type:data _index:session_data _score: - day_of_month:31 hour_of_day:11 day_of_week:4

```

> **Here is a JSON view of an element ("gameplay\_stat" index)**
>
> ```
> {
> "_index": "gameplay_stat",
> "_type": "data",
> "_id": "hNsdIm4BSOdvtuXl2yH7",
> "_version": 1,
> "_score": null,
> "_source": {
> "game": {
> "player": 450,
> "player_login": "Bruno Buccelati",
> "distance": 0,
> "avg_lifetime": 71
> },
> "room": {
> "id": 14172,
> "efficiency": 185,
> "platform": "Android 5.0+",
> "player_amount": 10,
> "build": "0.2.3.1011",
> "squad_size": 4,
> "map_name": "empty41",
> "game_mode": "CaptureThePoint",
> "created_at": "2019-10-31T12:57:06.000+00:00"
> },
> "kills": 7,
> "place": 1,
> "assist": 3,
> "death": 1,
> "character_key": 1,
> "character_name": "Fire",
> "character_lvl": 0,
> "is_tester": true,
> "leaver": null,
> "room_length": 151,
> "is_win": true
> },
> "fields": {
> "room.created_at": [
> "2019-10-31T12:57:06.000Z"
> ]
> },
> "sort": [
> 1572526626000
> ]
> }
> 
> ```

Its screenshot:

 ![](https://i.imgur.com/rRKbnDM.png)  
And some other elements of `gameplay_stat` index:

```
Oct 31, 2019 @ 14:56:38.000	game.player:464 game.player_login:Hate game.distance:0 game.avg_lifetime:43 room.id:14,171 room.efficiency:97 room.platform:Android 5.0+ room.player_amount:10 room.build:0.2.3.1011 room.squad_size:4 room.map_name:empty43 room.game_mode:CaptureThePoint room.created_at:Oct 31, 2019 @ 14:56:38.000 kills:8 place:1 assist:3 death:3 character_key:3 character_name:Lightning character_lvl:0 is_tester:true leaver: - room_length:139 is_win:false _id:ftsdIm4BSOdvtuXl2SHD _type:data _index:gameplay_stat _score: -
	
Oct 31, 2019 @ 14:54:12.000	game.player:451 game.player_login:Shiro Panos game.distance:0 game.avg_lifetime:70 room.id:14,167 room.efficiency:149 room.platform:Android 5.0+ room.player_amount:6 room.build:0.2.3.1009 room.squad_size:4 room.map_name:empty41 room.game_mode:CaptureThePoint room.created_at:Oct 31, 2019 @ 14:54:12.000 kills:10 place:1 assist:3 death:2 character_key:0 character_name:Frost character_lvl:0 is_tester:true leaver: - room_length:180 is_win:true _id:eNsdIm4BSOdvtuXl2CES _type:data _index:gameplay_stat _score: -
    	
Oct 31, 2019 @ 14:50:49.000	game.player:464 game.player_login:Hate game.distance:0 game.avg_lifetime:24 room.id:14,165 room.efficiency:145 room.platform:Android 5.0+ room.player_amount:10 room.build:0.2.3.1011 room.squad_size:4 room.map_name:empty43 room.game_mode:SkullGrab room.created_at:Oct 31, 2019 @ 14:50:49.000 kills:8 place:2 assist:7 death:6 character_key:2 character_name:Earth character_lvl:0 is_tester:true leaver: - room_length:184 is_win:false _id:ctsdIm4BSOdvtuXl1SHa _type:data _index:gameplay_stat _score: -
```

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [October 31, 2019, 2:45pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/8 "2019-10-31T14:45:05Z")

</div>

Could you post the result of this queries: `GET session_data/_mapping` and `GET gameplay_stat/_mapping` ? The source itself looks fine in general but maybe there is an issue in how the data is indexed by Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [October 31, 2019, 3:31pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/9 "2019-10-31T15:31:27Z")

</div>

Here they are:  
`{"session_data":{"mappings":{"properties":{"cpu_model":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"device":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"duration":{"type":"long"},"end_at":{"type":"date"},"gpu_model":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"id":{"type":"long"},"ip":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"is_tester":{"type":"boolean"},"player_id":{"type":"long"},"player_login":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"ram_amount":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"start_at":{"type":"date"}}}}}`

and

`{"gameplay_stat":{"mappings":{"properties":{"assist":{"type":"long"},"character_id":{"type":"long"},"character_key":{"type":"long"},"character_lvl":{"type":"long"},"character_name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"death":{"type":"long"},"game":{"properties":{"avg_lifetime":{"type":"long"},"distance":{"type":"long"},"player":{"type":"long"},"player_login":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"is_tester":{"type":"boolean"},"is_win":{"type":"boolean"},"kills":{"type":"long"},"leaver":{"type":"boolean"},"place":{"type":"long"},"room":{"properties":{"build":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"created_at":{"type":"date"},"efficiency":{"type":"long"},"game_mode":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"id":{"type":"long"},"map_name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"platform":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"player_amount":{"type":"long"},"squad_size":{"type":"long"}}},"room_length":{"type":"long"}}}}}`

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [November 1, 2019, 9:26am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/10 "2019-11-01T09:26:11Z")

</div>

Thanks, that's helpful.

So your mapping is looking fine but it seems like there is no `@timefield` field - this is used by default to aggregate over time in Timelion. If you want to use a different field for the time axis (as in this example), you have to specify it as the `timefield` parameter in the `.es()` function:

```auto
.es(interval=1d, timefield='start_at', index=session_data, metric='cardinality:player_id').label('Unique Players Logged')

```

Another detail: It's recommended to put the metric into quotes (as in the example above) to avoid conflicts with reserved characters in the field name.

See also [https://www.elastic.co/guide/en/kibana/current/timelion.html](https://www.elastic.co/guide/en/kibana/current/timelion.html) about more details.

Let me know whether that solves your problem.

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [November 1, 2019, 9:47am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/11 "2019-11-01T09:47:58Z")

</div>

Omg, it works. Thank you!

> [@flash1293](#):
>
> See also [Timelion | Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/timelion.html) about more details.

The last question: on the page you've mentionned I did not found how to change the line mode: now it's stepped. How to do this?

 ![](https://us1.discourse-cdn.com/elastic/original/3X/3/1/31214a9a6898f9dc066b601cbe7950d4182b8ce8.png)

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [November 1, 2019, 9:56am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/12 "2019-11-01T09:56:51Z")

</div>

You should be able to change it by appending `.lines(steps=false)` to the expression

```auto
.es(interval=1d, timefield='start_at', index=session_data, metric='cardinality:player_id').label('Unique Players Logged').lines(steps=false)

```

But I'm unsure why this is happending, _not_ using steps should be the default. @timroes do you know why this is happening?

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [November 1, 2019, 10:05am UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/13 "2019-11-01T10:05:11Z")

</div>

Nope. I've tried `.lines(steps=false)`, `.lines(steps=0)` and `.lines(steps=null)`.  
And nothing has changed

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [November 1, 2019, 12:31pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/14 "2019-11-01T12:31:15Z")

</div>

> [@Anne\_Kim](#):
>
> nothing has changed

2 hours later everything became ok (I've just edited the vizualization). May be it was a temporary bug.

---

<div class="post-metadata">

**Author:** ![Anne\_Kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anne_kim/32/47196_2.png) [@Anne\_Kim](https://discuss.elastic.co/u/Anne_Kim)\
**Post date:** [November 1, 2019, 3:28pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/15 "2019-11-01T15:28:54Z")

</div>

UPD. Lines become stepped if the interval is specified in the expression.  
E.g., `.es(interval=4h, timefield='start_at', index=session_data, metric='count:player_id')`  
If the interval is specified not in the expression (see screenshot), lines become straight.  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/6/966eac59b5d308ae081062a82892e939f06ec0b9.png)

---

<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 29, 2019, 3:28pm UTC](https://discuss.elastic.co/t/timelion-request-error-parsing-exception/205695/16 "2019-11-29T15:28:59Z")

</div>

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