我有一个名为Events
的索引
它包含许多不同的事件,所有事件都有一个称为EventName
的属性。现在,我想执行一个查询,返回与以下内容匹配的所有内容:
如果事件名称为AccountCreated
的事件中存在AccountId,并且事件名称为FavoriteCreated
的至少一个事件具有相同的帐户ID->返回事件名称== AccountCreated
的所有事件>
示例事件:
AccountCreated
{ "AccountId": 1234, "EventName": "AccountCreated", "SomeOtherProperty": "Some value" }
FavoriteCreated
{ "AccountId": 1234, "EventName": "FavoritesCreated }
鉴于以下两个事件,我想创建1个返回AccountCreated事件的查询。
我尝试了以下操作,但是它不起作用,肯定会丢失一些简单的内容吗?
index=events EventName=AccountCreated [search index=events EventName=FavoriteCreated | dedup AccountId | fields AccountId] | table AccountId, SomeOtherProperty
我预计这里会有〜6000次点击,但我只获得2298次活动。我想念什么?
我有一个名为Events的索引,它包含许多不同的事件,所有事件都有一个名为EventName的属性。现在,我想执行一个查询,返回与以下内容匹配的所有内容:IF ...
[您也许发现了one factor个问题-subsearches的上限是50,000(执行join
时))事件(或60秒的运行时间(或当您使用“常规”子搜索))。
[以10,000优先转储dedup
:
index=events EventName=AccountCreated AccountId=*
| stats count by AccountId, SomeOtherProperty [, more, fields, as, desired]
| fields - count
| join AccountId
[ | search index=events EventName=FavoriteCreated AccountId=*
| stats count by AccountId ]
| fields - count
<rest of search>