# Elasticsearch not detecting timestamp field from HBase table

**URL:** https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416
**Category:** Elasticsearch
**Created:** [March 18, 2014, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416 "2014-03-18T07:26:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sandip002](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@sandip002](https://discuss.elastic.co/u/sandip002)
#### Post date: [March 18, 2014, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416/1 "2014-03-18T07:26:20Z")

</div>

Hi,

I am loading my data from an Hbase table into Elasticsearch engine using  
Pig.

I have a column in my Hbase table called timestamp (with data like  
"2014-03-18 11:05:37.503").  
I want this field to be automatically detected as the timestamp field by  
the Elasticsearch (I need to add time filter on my Kibana dashboard).

Here's what I do in the PIG grunt shell:

REGISTER /path-to-my/elasticsearch-hadoop.jar;  
A = LOAD 'hbase://demo' USING  
org.apache.pig.backend.hadoop.hbase.HBaseStorage('cf:timestamp') as (  
timestamp:chararray);  
STORE A INTO 'demo/demo' USING org.elasticsearch.hadoop.pig.ESStorage();

Should I store the values for the field in any particular format?

How do I alter the above steps to suit my requirement?

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [March 18, 2014, 8:05am UTC](https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416/2 "2014-03-18T08:05:11Z")

</div>

Hi,

You can either convert the timestamp field in Pig to UTF format (try the dateTime type and its associated functions [1])  
or you can create the index mapping in Elasticsearch before indexing and define the time field format accordingly [2]

[1] [Built In Functions](https://pig.apache.org/docs/r0.11.1/func.html#datetime-functions)  
[2] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html)

On 3/18/14 9:26 AM, [sandip002@gmail.com](mailto:sandip002@gmail.com) wrote:

> Hi,
> 
> I am loading my data from an Hbase table into Elasticsearch engine using Pig.
> 
> I have a column in my Hbase table called timestamp (with data like "2014-03-18 11:05:37.503").  
> I want this field to be automatically detected as the timestamp field by the Elasticsearch (I need to add time filter on  
> my Kibana dashboard).
> 
> Here's what I do in the PIG grunt shell:
> 
> REGISTER /path-to-my/elasticsearch-hadoop.jar;  
> A = LOAD 'hbase://demo' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('cf:timestamp') as ( timestamp:chararray);  
> STORE A INTO 'demo/demo' USING org.elasticsearch.hadoop.pig.ESStorage();
> 
> Should I store the values for the field in any particular format?
> 
> How do I alter the above steps to suit my requirement?
> 
> Thanks.
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5327FE37.5030200%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5327FE37.5030200%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [March 18, 2014, 8:08am UTC](https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416/3 "2014-03-18T08:08:45Z")

</div>

To clarify - by UTF, I meant ISO format 🙂

On 3/18/14 10:05 AM, Costin Leau wrote:

> Hi,
> 
> You can either convert the timestamp field in Pig to UTF format (try the dateTime type and its associated functions [1])  
> or you can create the index mapping in Elasticsearch before indexing and define the time field format accordingly [2]
> 
> [1] [Built In Functions](https://pig.apache.org/docs/r0.11.1/func.html#datetime-functions)  
> [2] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html)
> 
> On 3/18/14 9:26 AM, [sandip002@gmail.com](mailto:sandip002@gmail.com) wrote:
> 
> > Hi,
> > 
> > I am loading my data from an Hbase table into Elasticsearch engine using Pig.
> > 
> > I have a column in my Hbase table called timestamp (with data like "2014-03-18 11:05:37.503").  
> > I want this field to be automatically detected as the timestamp field by the Elasticsearch (I need to add time filter on  
> > my Kibana dashboard).
> > 
> > Here's what I do in the PIG grunt shell:
> > 
> > REGISTER /path-to-my/elasticsearch-hadoop.jar;  
> > A = LOAD 'hbase://demo' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('cf:timestamp') as ( timestamp:chararray);  
> > STORE A INTO 'demo/demo' USING org.elasticsearch.hadoop.pig.ESStorage();
> > 
> > Should I store the values for the field in any particular format?
> > 
> > How do I alter the above steps to suit my requirement?
> > 
> > Thanks.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/93b5f866-464e-4457-917e-39a5ca1ba65f%40googlegroups.com?utm_medium=email&utm_source=footer).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5327FF0D.4010001%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5327FF0D.4010001%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 1:42am UTC](https://discuss.elastic.co/t/elasticsearch-not-detecting-timestamp-field-from-hbase-table/16416/4 "2017-07-06T01:42:38Z")

</div>


