append
Add the rows of a subsearch below your current results, without matching keys.
Use append to add a subsearch's rows below your current results. To merge rows on matching keys, use join.
Syntax
... | append [maxout=<n>] [ <subsearch> ]| Argument | Default | Description |
|---|---|---|
subsearch | required | A search in square brackets, for example [search class_uid=1007 | stats count by device.hostname]. |
maxout | 10000 | Total rows the subsearch may return. The maximum is 100000. |
How it works
- The subsearch rows follow the main rows. Columns are combined by name; a column that exists on only one side is empty on the other.
- Both sides must have the same kind of result: both raw events, or both ending in
statsortable. Appending atableorstatssubsearch to raw events (or the reverse) is rejected withthe main search and the appended subsearch produce different result shapes. - The subsearch runs over the main search's time range.
earliest=andlatest=inside the brackets are rejected. To compare periods within that range, bound the rows withwhere time >= ...andwhere time < ...in each search. - Rows beyond
maxoutare dropped. Aggregate in the subsearch when you can. - To identify each result set, add a label with
evalon each side.
Examples
Compare failed and successful logons per user in one labeled table:
class_uid=3002 status_id=2 | stats count as logons by user.name | eval outcome="failed" | append [search class_uid=3002 status_id=1 | stats count as logons by user.name | eval outcome="succeeded"]Outbound RDP and SMB sources in one list:
class_uid=4001 dst_endpoint.port=3389 | stats count by device.hostname | eval protocol="rdp" | append [search class_uid=4001 dst_endpoint.port=445 | stats count by device.hostname | eval protocol="smb"]A totals row under a per-source breakdown:
* | stats count by metadata.log_source | append [search * | stats count | eval metadata.log_source="(all sources)"]DNS lookups and web requests in one table, with a larger subsearch cap:
class_uid=4003 | table time, src_endpoint.ip, query.hostname | append maxout=50000 [search class_uid=4002 | table time, src_endpoint.ip, http_request.url.hostname]