mradamlacey / elasticsearch-tableau-connector

Tableau Web Data Connector for Elasticsearch
MIT License
149 stars 64 forks source link

Timestamp issue #4

Closed guitmz closed 8 years ago

guitmz commented 8 years ago

Hello again!

Not sure if this is really an issue. The connector works fine but all the timestamp fields are coming as null. Is this something known or something I may have done wrong?

Thanks

mradamlacey commented 8 years ago

Timestamp fields should be working - can you verify in your mapping that the field has type date?

guitmz commented 8 years ago

Hi,

Check this out, I believe it looks correct? This is the index I'm trying to use with Tableau.

curl -XGET 'http://localhost:9200/logstash-business-metrics-order/_mapping/business-metrics/field/timestamp'

Output:
{  
   "logstash-business-metrics-order":{  
      "mappings":{  
         "business-metrics":{  
            "timestamp":{  
               "full_name":"timestamp",
               "mapping":{  
                  "timestamp":{  
                     "type":"date",
                     "format":"dateOptionalTime"
                  }
               }
            }
         }
      }
   }
}
guitmz commented 8 years ago

Hi

Any news on that? It may be something on the tableau end?

Another question, is there a debug mode in the connector where I can see the data flow from connector to tableau?

Thanks

mradamlacey commented 8 years ago

Your mapping looks correct. Have you used the Tableau Connector SDK before? I would recommend that to see the data that Tableau is pulling back from the connector. It includes log entries and you can use your browser debugging tools to step through any of the Javascript.

Here's the info on the SDK: https://community.tableau.com/thread/178867

guitmz commented 8 years ago

@mradamlacey Hi sir, I was just writing to you. I've found out the problem!

when your code does this: item[field] = hits[ii].fields[field];

things go crazy 'cause my logstash made the fields.timestamp and fields.@timestamp a list. Yes, a freaking LIST.

To correct the problem, I had to change that line to:

item[field] = hits[ii].fields[field][0];

And it looks fine now! Many thanks and sorry to bother :)

but you should add some debugging to the application anyways!

mradamlacey commented 8 years ago

Please submit a pull request if you think this is a generalizable issue that the connector should account for.

guitmz commented 8 years ago

Will check that. I'll close this for now, if a PR is submitted, I'll reference this issue in it.

Thanks again