Simple question, but I could not find any documentation about that. On Discover view I can see scripted field values but on my vega visualizations I can not.
This is my current spec:
{
$schema: "https://vega.github.io/schema/vega-lite/v2.json"
mark: line
data: {
url: {
%context%: true
%timefield%: timestamp
index: gaptrader.heartbeat
body: {
size: 10000,
// _source: ['timestamp', 'lastSignal', 'lastSignalSeconds']
}
}
format: { property: "hits.hits" }
}
transform: [
{
calculate: "toDate(datum._source['timestamp'])"
as: "time"
}
]
encoding: {
x: {
field: time
type: temporal
axis: { title: false }
}
y: {
field: lastSignalSeconds
type: quantitative
axis: { title: false }
}
}
}
and I want my (already created) scripted field lastSignalSeconds to be shown on my chart. I tried many things like
lastSignalSeconds
datum.lastSignalSeconds
_source.lastSignalSeconds
_source['lastSignalSeconds']
but nothing seems to work. What is the correct syntax accessing scripted fields?