top of page

Elasticsearch using script to query object

  • taolius
  • Jul 28, 2017
  • 1 min read

{ "bool" : { "must" : [ { "term" : { "requestId" : { "value" : "0f6b1e41-5457-4a75-b5f1-d88ed899a1a6", "boost" : 1.0 } } }, { "term" : { "siteId" : { "value" : "807cd4ff-788b-4388-9be2-4380b22bac01", "boost" : 1.0 } } }, { "term" : { "orgId" : { "value" : "9444cd78-c189-45d7-a5a2-6f04c2e963bd", "boost" : 1.0 } } }, { "script" : { "script" : { "inline" : "params_source.unreachableList.containsValue('Port not open)", "lang" : "painless" }, "boost" : 1.0 } } ], "disable_coord" : false, "adjust_pure_negative" : true, "boost" : 1.0 } }

"unreachableList": { "properties": { "key": { "type": "keyword" } } }

sample data:

{ "_index": "meridian_topology_9999.99.99", "_type": "deviceScheduleBrief", "_id": "9444cd78-c189-45d7-a5a2-6f04c2e963bd:807cd4ff-788b-4388-9be2-4380b22bac01:0f6b1e41-5457-4a75-b5f1-d88ed899a1a6:17", "_score": 1.6000781, "_source": { "docStatus": null, "lastUpdateTime": "2017-07-28T12:09:07.319Z", "updateLog": null, "orgId": "9444cd78-c189-45d7-a5a2-6f04c2e963bd", "siteId": "807cd4ff-788b-4388-9be2-4380b22bac01", "groupId": "default", "deviceId": null, "hostName": "fshqdellvc", "fqdn": null, "ipAddress": "172.16.2.33", "vendor": "VMWARE", "roles": null, "service": null, "isVirtual": "YES", "blackListStatus": null, "devType": "Compute", "devSubType": "VM", "reachableList": [ "PYSPHERE", "PING" ], "unreachableList": { "HP_3PAR": "Port not open", "EXTREME_IO": "No Credentials Available", "NUTANIX": "Port not open", "F5": "No Credentials Available", "UCSM": "No Credentials Available", "XEN": "No Credentials Available", "SNMP": "No Credentials Available", "EMCNAVISEC": "No Credentials Available", "TELNET": "Port not open", "SSH": "No Credentials Available", "CITRIX": "No Credentials Available", "VMAX": "Port not open", "WMI_QUERY": "Port not open", "WMI_SHELL": "No Credentials Available", "NETAPP": "No Credentials Available" }, "managers": {}, "jobStatus": "COMPLETE", "jobId": "17", "requestId": "0f6b1e41-5457-4a75-b5f1-d88ed899a1a6", "location": null, "vmName": "fshqdellvc" } }


 
 
 

コメント


© 2023 by BI World. Proudly created with Wix.com

  • Facebook Basic Black
  • Twitter Basic Black
  • YouTube Basic Black
bottom of page