Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field @timestamp is mapped as type:string #15

Closed
ml-jzimmermann opened this issue Mar 25, 2019 · 4 comments
Closed

Field @timestamp is mapped as type:string #15

ml-jzimmermann opened this issue Mar 25, 2019 · 4 comments

Comments

@ml-jzimmermann
Copy link
Contributor

The timestamp field is mapped as string. Please update the mapping before the index creation to fix this issue.

This issue was created as a result of the #11 Issue.

Thanks,
Julius

@deepujain
Copy link
Contributor

Hello Julius
I do not have the full setup with me. Upon running nvidiagpubeat locally with localnvidiasmi (simulator to generate dummy gpu utilization). All I see is

{
  "@timestamp": "2019-03-25T22:58:35.872Z",
....
}

Can you elaborate, how the field is being mapped as string.
I believe this field is coming from line 81 from nvidiagpubeat.go and i see the type as Time and not string.

Timestamp: time.Now(),

Can you elaborate, on how to reproduce this issue or provide a PR ?

Regards,
Deepak

@ml-jzimmermann
Copy link
Contributor Author

Hi,
I added an IndexPattern "nvidiagpubeat-*" to match the elasticsearch index. The elasticsearch index that is created by the beater has the @timestamp field mapped as "keyword".

https://ibb.co/tQ7yjPg

Regards,
Julius

@ml-jzimmermann
Copy link
Contributor Author

Hi again,

i am closing this issue for now because logstash also fixes this. I dont see / know how to change this behaviour in the code. I suppose to use logstash for the future anyways. This is my logstash config to parse this beater output into elasticsearch:

input {
beats {
port => "5044"
}
}

filter {
}

output {
elasticsearch {
hosts => [ "localhost:9200" ]
}
}

Regards,
Julius

@nperron
Copy link

nperron commented Mar 9, 2021

Hello, i had the same issue. The timestamp was set as "keyword" type because of wrong template.

[...]
"dynamic_templates":
{
"string_as_keyword" : {
"mapping" : {
"ignore_above": 1024,
"type": "keyword"
[...]

In fact, the issue was that the templates files were absent (by default, should be present in the same folder than the binary), so nvidiagpubeat wasn't able to set it correctly to ElasticSearch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants