Hi
i've got a similar scenario where i am trying to store current timestamp (EPOCH) into a KVStore.
however i cant seem to get it working.Some help will be appreciated
// Create Search manger to get current timestamp EPOCH TIME
var timestamp_search = new SearchManager({
"id": "timestamp_search",
"status_buckets": 0,
"latest_time": "$latest$",
"search": "| stats count as timestamp | eval timestamp = now()",
"earliest_time": "$earliest$",
"cancelOnUnload": true,
"app": utils.getCurrentApp(),
"auto_cancel": 90,
"preview": true,
"runWhenTimeIsUndefined": false
}, {tokens: true});
// retrieve data from search manager
var timestamp_search_obj = timestamp_search.data("preview");
timestamp_search_obj.on("data", function() {
var timestamp_search_result = timestamp_search_obj.data().rows;
});
// Create a dictionary to store the field names and values
var record = {
"time-stamp": timestamp_search_result
};
... View more