deepsecurity - 搜索字段 lastIPUsed 不可搜索
问题描述
我正在尝试使用 IP 作为搜索条件来搜索计算机,但控制台响应为不可搜索字段:
Exception: (400)
Reason:
HTTP response headers: HTTPHeaderDict({'X-Frame-Options': 'SAMEORIGIN', 'X-XSS-Protection': '1;mode=block', 'Cache-Control': 'no-cache,no-store', 'Pragma': 'no-cache', 'X-DSM-Version': 'Deep Security/11.2.225', 'Content-Type': 'application/json', 'Content-Length': '73', 'Date': 'Wed, 20 Feb 2019 00:51:37 GMT', 'Connection': 'close'})
HTTP response body: {"message":"Invalid SearchFilter: lastUsedIP is not a searchable field."}
计算机对象有一个 lastIPUsed 字段,如下所示
完整方法:
def search_computer_by_ip(configuration, host_ip):
host_ip_criteria = deepsecurity.SearchCriteria()
host_ip_criteria.field_name = "lastIPUsed"
host_ip_criteria.string_test = "equal"
host_ip_criteria.string_value = host_ip
search_filter_host_ip = deepsecurity.SearchFilter(None, host_ip_criteria)
try:
api_response = deepsecurity.ComputersApi(deepsecurity.ApiClient(configuration))
return api_response.search_computers(api_version, search_filter=search_filter_host_ip)
except ApiException as e:
print("Exception: %s\n" % e)
那是一个错误吗?
解决方案
这不是一个错误。在 API 参考中,展开 Search Computers 操作的 200 响应以查看 Computer 字段的描述。您会看到描述表明它们是否可搜索—— displayName 就是一个很好的例子。lastIPUsed 字段并不表示它是可搜索的。
希望有帮助,
-Scott(Deep Security 的内容开发人员)
推荐阅读
- html - 在反应材料-ui按钮中自动调整字体大小以获取意外的长内容?
- python - 从python脚本在flutter应用程序中显示数据的有效方法
- android - 无法使用 Flutter 将文件上传到 FirebaseStorage
- c - 我们的 C 代码中用于 CFS 调度的示例代码
- java - 双值之和,奇怪的结果
- node.js - 对 Node 后端/Angular 前端中的 socket.io 事件系统进行故障排除
- android - 如何解决这个问题:Android Studio /error/ItemAdapter?
- linux - var/log/syslog.1 文件正在迅速扩展
- node.js - Webpack:无法分配给对象'#的只读属性'exports'