# Help - i'm trying Timelion but I don't have a date/timestamp field :)

**URL:** https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471
**Category:** Kibana
**Tags:** timelion
**Created:** [November 20, 2017, 10:40pm UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471 "2017-11-20T22:40:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gosha1128](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@gosha1128](https://discuss.elastic.co/u/gosha1128)
#### Post date: [November 20, 2017, 10:40pm UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/1 "2017-11-20T22:40:06Z")

</div>

Hi,

I have a lot of custom data in ES, but there is no date or timestamp field. I have instead a large integer that represents UNIX time in microseconds.

Can I still use Timelion ? Or do I need to do other another visualization stack ?

Thanks !

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [November 20, 2017, 11:24pm UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/2 "2017-11-20T23:24:02Z")

</div>

Yeah, you probably need a timestamp field, so that you can run the date\_histogram. I would recommend re-indexing your data and creating a timestamp field with that large integer.

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![gosha1128](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@gosha1128](https://discuss.elastic.co/u/gosha1128)
#### Post date: [November 21, 2017, 12:41am UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/3 "2017-11-21T00:41:37Z")

</div>

Great thanks ! Is that easy to do in elastic ? I’m an elastic noob...

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [November 21, 2017, 1:23am UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/4 "2017-11-21T01:23:37Z")

</div>

Yes indeed. Its very easy. Follow - [https://www.elastic.co/guide/en/kibana/current/index-patterns.html](https://www.elastic.co/guide/en/kibana/current/index-patterns.html)

[https://www.elastic.co/guide/en/kibana/current/getting-started.html](https://www.elastic.co/guide/en/kibana/current/getting-started.html)

Do let me know if you have any q.

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![gosha1128](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@gosha1128](https://discuss.elastic.co/u/gosha1128)
#### Post date: [November 21, 2017, 2:53am UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/5 "2017-11-21T02:53:47Z")

</div>

Hmm. I might be missing something easy...

It looks like I want to create a "scripted" field from an existing field.

It turns out the source field is a string.

If I use the painless script editor, it seems to be failing. And its not  
clear to me what the error is as I get no feedback from the script editor:

I'm trying to do something like this, as a first step to converting it to a  
timestamp:

> > painless \<\<

return (long) doc['publishTimeMicros].value

> > painless \<\<

But even that doesn't work. And I assume its not working because after I  
create the scripted field and go back to "Discover" no searches work. But  
if I delete the scripted field, everything returns to normal.

---

<div class="post-metadata">

### Author: ![gosha1128](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@gosha1128](https://discuss.elastic.co/u/gosha1128)
#### Post date: [November 21, 2017, 7:33am UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/6 "2017-11-21T07:33:02Z")

</div>

Hey, so I ended up just creating a timestamp field outside of elastic -  
before i give the data to elastic.

I used python datetime objects...in case anyone is interested in a hacky  
workaround...

-g

---

<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: [December 19, 2017, 7:34am UTC](https://discuss.elastic.co/t/help-im-trying-timelion-but-i-dont-have-a-date-timestamp-field/108471/7 "2017-12-19T07:34:03Z")

</div>

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