Cancelling long-running queries with Active Query Management

Active Query Management in Security Onion Pro lists and cancels slow Elasticsearch queries for superusers, but it cannot show who started them and cancelling internal queries can disrupt the cluster.

On this page

When one slow search holds up every analyst on the grid

Active Query Management is the Security Onion Pro feature for finding and cancelling Elasticsearch queries that have run too long. When analysts report that every search is slow and the cluster looks busy, a few long-running queries are often the cause, and cancelling them can restore responsiveness faster than waiting for each one to finish. The feature lists those queries and lets a superuser cancel them. It is visible only to superusers, so the first decision is who on your team holds that role and who needs to be contacted when a hunt is blocking others. Confirm the role model in your own deployment before you rely on the feature in an incident.

Teams usually reach for it in two situations: a hunt or dashboard that runs a broad time range across large indices, and a scheduled or automated search that keeps competing with interactive work. Waiting is reasonable when the query is close to finishing and the cluster has spare capacity. It is the wrong choice when the same search keeps consuming resources, or when the slowdown affects many analysts at once. Note that Elasticsearch does not report which user started a query, so the list shows what is running but not who to ask. Agree on a channel for analysts to flag their own long searches before you need to cancel someone else's.

Before you cancel anything, check what the query is. The docs warn that cancelling internal queries can disrupt Elasticsearch, so every entry in the list needs to be identified as an analyst search or as an internal process before you act. Record what you cancelled, when, and why, so the same query pattern can be fixed in the hunt or the dashboard rather than cancelled again. For guidance on the feature itself, read the Security Onion docs: Active Query Management page and confirm the current behavior against the version you run.

How to find and cancel a long-running query safely

This sequence lets a superuser confirm the feature is available, identify the query slowing the cluster, and cancel it only when the evidence points to an analyst's search. It ends with a check that the cluster responds normally again.

  1. Confirm Pro licensing and superuser access

    Before anything else, confirm that your grid runs Security Onion Pro, since Active Query Management is a Pro feature. Then confirm that the account you plan to use holds the superuser role, because the feature is visible only to superusers. Check your license status and role assignments with your administrator, and if either is missing, stop here and resolve it first. You know this step is done when the Active Query Management page loads for your account without an access error. Exact menu paths are in the Active Query Management docs.

  2. Open Active Query Management

    Sign in to the Security Onion Console as a superuser and open the Active Query Management view from the location described in the vendor documentation. Do not change any settings yet. You know this step is done when the page lists the currently running Elasticsearch queries, even if the list is empty. If the page shows no queries while analysts report slow searches, note the time and continue to the next step, because the slowdown may have already ended or may come from a different component.

  3. Review running queries and their run times

    Sort or scan the list by run time so the longest-running queries are at the top. Note each query's start time, duration and the content of the query. Compare these durations with what analysts are reporting, such as which searches are hanging or when the slowdown began. Keep in mind that a long run time alone does not prove a problem, because some queries are legitimate large hunts. You know this step is done when you have a short list of candidates with their start times and durations written down.

  4. Identify each query by content and time

    Elasticsearch does not report which user started a query, so do not rely on a username to decide what to cancel. Instead, match each candidate's query content and start time against what analysts were doing at that moment, such as a broad search over a long time range or a wildcard across many fields. Also check whether the query matches a known internal process, such as a health check, a scheduled job or a component of the platform itself. Ask the analysts involved if the match is unclear. You know this step is done when each candidate is labeled either as likely analyst-initiated or as unknown or internal.

  5. Cancel only clearly analyst-initiated queries

    Cancel a query only when its content and timing clearly match an analyst search, and when you can confirm the analyst is not waiting on the result. Leave any query you cannot attribute, and leave every internal query alone, because cancelling internal queries can disrupt Elasticsearch. Record the query content, start time, duration and the reason for cancelling in your change or incident notes. You know this step is done when the query no longer appears in the list and your notes show the decision. If you are unsure, escalate to the platform owner rather than cancelling.

  6. Recheck cluster responsiveness

    After cancelling, wait for the list to refresh and confirm that the cancelled query is gone and that no internal query was affected. Then ask analysts to run a simple, known search and confirm it returns promptly. Check the Elasticsearch health indicators your team already monitors, and confirm the cluster status matches what it was before the incident. You know this step is done when analysts confirm normal responsiveness and the health indicators show no new errors. If the slowdown returns, treat it as a sizing or query design issue and review the query pattern with the team.

Which queries to cancel and which to leave running

Ad hoc searches and hunts are the most common cause of slow queries that a superuser can safely cancel, but only after review. An analyst may have started a broad time range or a leading wildcard search that is now consuming shared cluster resources. Because Elasticsearch does not identify the user who started a query, you need to match the query to a person through your own records, such as the analyst's shift notes, the case in progress or a direct message, before you act.

  • Broad time ranges: Queries spanning weeks of data across many indices often run far longer than a focused hunt needs.
  • Leading wildcards and unbounded regex: These patterns force scans across large portions of an index and are frequent culprits.
  • Contact first: Confirm with the analyst whether the search is still needed and whether a narrower query would return the same answer.
  • Document the cancellation: Record the query text, time, and reason in your case or change notes so the analyst can rerun it.
  • Prefer narrowing over cancelling: Suggest a tighter time window or field filter when the work is legitimate.

Before cancelling any analyst query, check that the person who owns it has been told and that its results are not needed for an open investigation.

Access, audit and trust risks when cancelling queries

Active Query Management gives a small group of superusers power over shared Elasticsearch work that every analyst depends on. The cards below cover who can reach the feature, what cancelling can break, what the output leaves out, and how your own process has to fill the gaps before you cancel anything.

Superuser-only visibility

Active Query Management is a Pro feature that only superusers can see. Treat this as the first access control: decide who holds the superuser role, and confirm in your own Security Onion Console that analysts with lower roles cannot list or cancel running queries. Review that role assignment on a schedule, because the people who need the feature change as the team changes.

Active Query Management docs

Cancelling internal work

The list includes queries that Security Onion and Elasticsearch run for themselves, not only analyst searches. Cancelling one of these can disrupt Elasticsearch, so a superuser should never cancel a query on sight. Before cancelling, confirm with the documentation for your version which queries are internal and what the platform does when one stops.

No user attribution in output

Elasticsearch does not report which user started a query. The list shows what is running and how long it has run, but not whom to contact. Before you cancel a query that belongs to a person, you need another way to find the owner, such as asking the analysts on shift or matching the query text to a case in your ticketing system.

Recording cancellations yourself

Because the platform does not record who cancelled what, your team has to. Keep a simple log with the time, the query identifier, the reason, the approving person and the superuser who acted. Confirm whether your Security Onion logging or your SIEM captures these actions already, and whether that record is retained long enough for your review cycle.

Named administrators for Pro access

Limit Security Onion Pro access, including superuser accounts, to named administrators who each log in with their own identity. Shared superuser logins make the audit log in the previous card meaningless. Confirm that your identity provider setup, such as OIDC single sign-on, ties each superuser action to one person, and remove access promptly when an administrator leaves.

How a long query moves from analyst to cancellation decision

The path starts when an analyst's search runs slowly in Elasticsearch and the cluster's query load builds up. A superuser opens Active Query Management, which lists running queries but does not show which user started each one, so the superuser must confirm ownership before acting. The key decision is whether a query belongs to an analyst and can be cancelled, or is an internal Elasticsearch query that should be left alone. After any cancellation, check cluster health to confirm the cluster is recovering.

Decision path from a slow analyst search to a cancel or leave-alone choice.

Questions teams ask before cancelling Elasticsearch queries

Is Active Query Management included in the free Security Onion edition?

No. Active Query Management is a Pro feature, so it is not part of the free Security Onion distribution. It is visible only to superusers, which means a standard analyst account will not see the query list or the cancel control. Confirm the feature list for your edition on the Security Onion Pro page before you plan around it. If you run the free edition, you will need another way to find slow queries, such as Elasticsearch monitoring you already operate, and a documented procedure for the people who can stop them.

What does Security Onion Pro cost, and what drives the effort?

Pro is a paid edition sold on terms of 1 to 5 years, according to the Pro page. Obtain the exact price from Security Onion Solutions, since it is not part of the researched facts used here. The subscription is recurring, so budget it as an annual or term commitment rather than a one-time purchase. Internal effort depends on how many people run the query review, how often slow queries occur, and how many analysts depend on the grid. A quote for outside help should list the grid size, the number of superuser accounts to set up, and whether the work includes a written runbook.

How long does a query review take on a large grid?

The time depends on grid size, query volume and how many people must agree before a query is stopped. Duration is not a figure supplied for this topic, so ask your vendor or partner for an estimate based on your own node count and search history. Larger grids usually produce more concurrent queries, which means more lists to read and more context to gather before a cancel decision. A useful first step is to measure a normal working day on your grid so the review is based on your data, not on an assumed workload.

Can analysts cancel their own slow queries?

Analysts can usually stop their own work through the Console, but Active Query Management itself is limited to superusers. Elasticsearch does not report which user started a query, so the superuser must match a slow query to a person through timing, the Console session, or the analyst's report. Agree on a rule in advance: analysts narrow or re-run their own searches, and superusers cancel only when a query is blocking others or threatening cluster health. Document that rule so cancellations do not become a surprise to the team.

What access and training does the work need?

The person who cancels queries needs superuser access in the Console, a working understanding of Elasticsearch search and task behavior, and enough familiarity with the grid to recognize normal load. Access should be limited to a small number of named people, reviewed regularly, and protected with the same authentication controls as other administrative accounts. Training should cover how to read the active query list, how to identify internal queries, and what to do when a cancel affects an analyst. Ask any partner to show how their team records each cancellation so the trail stays auditable.

How do I tell an internal query from an analyst query?

Internal queries are issued by Security Onion components to keep the platform working, while analyst queries come from hunting, dashboards and investigations. Cancelling internal queries can disrupt Elasticsearch, so treat any query you cannot attribute to an analyst as one to leave alone until you have confirmed its source. Check the query text and index targets, compare the timing with scheduled platform activity, and ask the team before acting. When in doubt, wait and observe, and record the query so the decision can be reviewed later.

What should I check after cancelling a query?

Confirm that the cluster health remains stable and that the cancelled query did not belong to a platform process. Check the Elasticsearch status on the grid and watch for analysts reporting failed searches. If a cancellation disrupts an internal process, follow your incident procedure rather than repeating the cancel. Keep a short log with the time, the query summary, the reason, and the person who acted. Review that log periodically so you can tune the rules for when cancellation is appropriate and when the cause should be fixed instead.

What to confirm before relying on Active Query Management

The supplied documentation describes what Active Query Management does at a high level but leaves several operating details open. The cards below list what to verify in the Security Onion docs or in your own test grid before analysts depend on the feature during an investigation.

Which query types appear

The list shows long-running Elasticsearch queries, but the supplied material does not say whether it includes aggregations, scroll requests, search templates or queries from scheduled jobs. Run a controlled test with a slow search, an aggregation and a dashboard load, then confirm each one shows up. If a query type is missing, analysts will still need the command line or Elasticsearch tooling to find it.

Active Query Management docs

The long-running threshold

Confirm the time after which a query counts as long-running and whether that value can be changed. A threshold that is too short will flag normal hunts, while one that is too long lets a runaway query hold cluster resources. Record the default you observe in your environment so the team can judge whether it fits the hunting workload.

Partial results after cancellation

Ask whether a cancelled query returns partial results, an error, or nothing to the analyst who started it. This determines whether an investigator can keep useful output or must rerun the search with a narrower time range. Test a cancellation on a long hunt and note exactly what the analyst's session shows afterward.

Behavior across distributed grids

Verify whether the list shows queries from every search node in a Distributed deployment or only from the manager, and whether cancelling on one node affects the others. Because Elasticsearch does not report which user started a query, confirm how a superuser can match a running query to an analyst or case. Test this on a grid that matches your production layout.

Architecture docs

Upgrade path between 3.x releases

Check whether Active Query Management behaves the same across 3.x releases and whether any setting or permission changes survive an upgrade. The grid runs 3.0.0 or later on Oracle Linux 9, and the latest tagged release is 3.3.0, so confirm the feature on the version you plan to run before and after each upgrade. Keep a test node on the target release for this check.

Internal queries to exclude

Before cancelling anything, confirm which internal Elasticsearch queries the platform runs and which ones must not be stopped. The supplied material warns that cancelling internal queries can disrupt Elasticsearch, so agree on a rule with the platform team and document it for superusers.

Why long queries pile up on distributed grids

A single broad query can keep a shared cluster busy for everyone. Elasticsearch runs each search across every shard that holds matching data, so a hunt over a wide time range, a leading wildcard, or a query with no field scoping can tie up search threads long after the analyst has moved on. When several analysts run similar hunts at once, the cluster spends its capacity on work that no one is waiting for, and interactive searches slow down. The effect is not limited to the person who started the query, which is why the problem shows up as a general slowdown rather than as one stuck screen.

In a distributed grid, that load lands on the search nodes, not on the manager. The Security Onion architecture docs describe a design with a manager node, sensor nodes and search nodes, and note that search nodes stop indexing if they cannot reach Redis on the manager. Query work follows the same pattern: the manager coordinates the console and the grid, while the data nodes do the heavy lifting. Before you plan any cancellation, confirm on your own grid which nodes hold the shards behind your busiest indices, and whether a slowdown is coming from query load or from ingest pressure on the same nodes.

Start by identifying the pattern, not the person. Elasticsearch does not report which user started a query, so a list of long-running searches tells you what is slow, not who ran it. Look for repeated hunts with the same broad range, scheduled or automated searches that overlap, and internal queries from Security Onion components. Confirm which of these are expected behavior in your environment before you decide that any running query is a candidate for cancellation.

How DeployOpen scopes Security Onion query operations

DeployOpen approaches Active Query Management as one part of running a Security Onion grid, not as a standalone switch. We scope who may view and cancel queries, which slow searches matter to your analysts, and which internal Elasticsearch queries must be left alone, then write the procedure your superusers will follow.

How we scope

  • The written scope names the Security Onion Pro entitlement, the superuser accounts involved and the analyst groups affected.
  • We agree which query patterns count as slow for your team and how superusers record each cancellation.
  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.

How we build

  • We configure Active Query Management access on the Pro deployment and confirm that only superusers can see the query list.
  • We test cancellation against non-production queries and document which internal query types must never be stopped.
  • We write a triage procedure that links slow query symptoms to the analyst searches and time ranges that caused them.

How we hand over

  • You receive the configuration record, the superuser runbook, the list of protected internal queries and the test results.
  • We walk your superusers through identifying a query, confirming its origin with analysts and cancelling it safely.
  • We document what Elasticsearch does not report, such as which user started a query, so your team plans around it.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for grids that change over time.
  • We can review the runbook after Security Onion upgrades or Elasticsearch health incidents to confirm the procedure still holds.
  • Quotes follow from the written scope, so ask for the scope items that affect effort before you approve the work.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.