add some unanalyzed fields for better searches

This commit is contained in:
Dave Pedu 2015-12-05 17:48:57 -08:00
parent ef62815af6
commit 8f9df8d04d
2 changed files with 13 additions and 0 deletions

View File

@ -81,6 +81,7 @@ class Backend:
Fetch generic system info that is sent with every piece of monitoring data
"""
self.sysinfo["hostname"] = sysinfo.hostname()
self.sysinfo["hostname.raw"] = self.sysinfo["hostname"]
self.sysinfo["ipaddr"] = sysinfo.ipaddr()
def get_index_name(self):
@ -100,6 +101,13 @@ class Backend:
"properties": {
"ipaddr": {
"type": "ip"
},
"hostname": {
"type": "string"
},
"hostname.raw": {
"type" : "string",
"index" : "not_analyzed"
}
}
}

View File

@ -6,6 +6,7 @@ def diskspace(filesystems=[]):
info = {
"fs": fs,
"fs.raw": fs,
"diskfree": stats.f_bsize * stats.f_bavail,
"diskused": (stats.f_blocks-stats.f_bavail) * stats.f_bsize,
"disksize": stats.f_bsize * stats.f_blocks
@ -36,6 +37,10 @@ mapping = {
},
"fs": {
"type": "string"
},
"fs.raw": {
"type" : "string",
"index" : "not_analyzed"
}
}
}