I'm trying to create a vega visual, but receiving 'invalid field type "undefined"'
The 2 fields are strings, and the @timestamp a a date field. I've also tried it without converting the @timestamp to a date, and passing the @timestamp to x, but that gives me the same error.
Here is the json:
{
$schema: https: //vega.github.io/schema/vega-lite/v2.json
mark: point
data: {
url: {
%context%: true
%timefield%: @timestamp
index: service-appointment-prod-*
body: {
size: 10000
_source: [
"@timestamp",
"system.process.memory.rss.bytes",
"system.filesystem.files"
]
}
}
format: { property: "hits.hits"
}
}
transform: [
{
calculate: "toDate(datum._source['@timestamp'])"
as: "time"
}
]
encoding: {
x: {
field: time
type: temporal
axis: { title: false
}
}
y: {
field: _source.system.process.memory.rss.bytes
type: quantative
axis: { title: "bytes"
}
}
}
}
I am able to perform a search using those fields:
GET service-appointment-prod-*/_search
{
"size": 10,
"_source": [ "@timestamp","system.process.memory.rss.bytes","host"]
}
returns:
{
"took": 51,
"timed_out": false,
"_shards": {
"total": 119,
"successful": 119,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 17727946,
"max_score": 1,
"hits": [
{
"_index": "service-appointment-prod-2018.03.15",
"_type": "doc",
"_id": "RTmjK2IBt7mrOhHx1Cni",
"_score": 1,
"_source": {
"@timestamp": "2018-03-15T21:49:38.880Z",
"host": "stlrck-vcrh001"
}
},
{
"_index": "service-appointment-prod-2018.03.15",
"_type": "doc",
"_id": "1Z6jK2IB4hB-5zYa1M_i",
"_score": 1,
"_source": {
"@timestamp": "2018-03-15T21:49:39.033Z",
"system": {
"process": {
"memory": {
"rss": {
"bytes": 1018032128
}
}
}
},
"host": "stlrck-vcrh001"
}
},