Hi Grafaners,
Thanks a lot for reading my issue,
I did install and configure Grafana & Elasticsearch to start display my data,
i succeeded adding Elasticsearch as a Datasource and then i tried to add an index , mapping the fields , adding some documents then i tried parsing queries but no success.
Let me share my scripts and state
After creating the index i launched this script to add mapping :
`var elasticsearch = require('elasticsearch');
var time = Date.now || function() {
return +new Date;
};
var client = new elasticsearch.Client({
host: 'localhost:9200'
});
client.indices.putMapping({
index: 'monitor',
type: 'data',
body: {
properties: {
'name': {
'type' : 'text',
'index': 'analyzed'
},
'temp' : {
'type' : 'integer',
'index': 'analyzed'
},
'hum' : {
'type' : 'integer',
'index': 'analyzed'
},
'currentValue': {
'type' : 'float',
'index': 'analyzed'
},
'timestamp': {
'type' : 'date',
'index': 'analyzed',
'format': 'epoch_millis'
}
}
}
}, function(err,resp,status){
if (err) {
console.log(err);
}
else {
console.log(resp);
}
});`
Then i did the same for populating the elasticsearch with data :
var elasticsearch = require('elasticsearch'); var time = Date.now || function() { return +new Date; }; var client = new elasticsearch.Client({ host: 'localhost:9200' }); client.create({ index: 'monitor', type: 'data', id: '2', body: { name: "node", temp: 42, hum : 86, currentValue: 195.991, timestamp : time() } }, function (error) { if (error) { console.error('elasticsearch cluster is down!'); } else { console.log('All is well'); } });
I did this 10 times to have different values for testing,
I tried Query Variable too but no suceess too
Could you please tell me what iโm missing here,
Thanks for any helpful answer,
Cheers
Mohammed