发现Splunk SDK for C#v2.2.3存在问题。
当我提交的搜索没有返回任何结果时,我的代码执行会在枚举来自SearchResultStream的结果时挂起:
using (SearchResultStream stream = await _service.SearchOneShotAsync(searchCommand, 0, new JobArgs { EarliestTime = earliestTime, LatestTime = latestTime }))
{
foreach (var searchresult in stream)
{
result.add(searchresult);
}
}
还尝试直接使用枚举器,但它没有帮助,程序挂起enumerator.MoveNext()
:
using (SearchResultStream stream = await _service.SearchOneShotAsync(searchCommand, 0, new JobArgs { EarliestTime = earliestTime, LatestTime = latestTime }))
{
var enumerator = stream.GetEnumerator();
while (enumerator.MoveNext())
{
result.Add(enumerator.Current);
}
}
有人遇到过同样的问题吗?有没有解决方法? 我们使用Splunk Enterprise 6.3.3版。