ESQL Syntax

approved

by Caio Lopes

Syntax highlighting for Elasticsearch ES|QL in fenced code blocks. - This plugin has not been manually reviewed by Obsidian staff.

45 downloadsUpdated 1mo agoMIT

ESQL Syntax

ES|QL syntax highlighting for Obsidian code blocks.

Document Elasticsearch investigations, searches, dashboards, and threat-hunting queries with readable ES|QL highlighting. ESQL Syntax plugs into Obsidian's native code-block pipeline, so esql blocks behave exactly like built-in languages in Reading View, Live Preview, and source mode on desktop and mobile.

ES|QL syntax highlighting in Obsidian

Usage

FROM logs-*
| WHERE host.name == "web-01"
| STATS events = COUNT(*) BY user.name
| SORT events DESC

Use esql as the fenced-code language. Blocks highlight through Obsidian's native code-block pipeline in both editing and reading modes: colorization stays active while you edit, the language flair copies the block ("Copied to your clipboard"), and colors come from your theme's code variables.

Highlighted syntax

TokenExamples
Directives and source commandsSET, FROM, ROW, SHOW, TS
Processing commandsWHERE, EVAL, STATS, SORT, LOOKUP JOIN
FunctionsCOUNT, DATE_EXTRACT, MATCH, CIDR_MATCH, MV_APPEND
Fields and identifiers@timestamp, host.name, `field-with-dash`
Strings and comments"text", """raw text""", //, /* ... */
Literals and parameters-.1e2, 1 day, ?, ?pattern
Operators==, !=, :, ::, LIKE, RLIKE, IS NOT NULL

Install

Community plugins

After acceptance into the Obsidian Community directory, search for ESQL Syntax under Settings → Community plugins.

Manual installation

  1. Download main.js, manifest.json, and styles.css from the latest matching GitHub release.
  2. Create <vault>/.obsidian/plugins/esql-syntax/.
  3. Copy all three files into that directory.
  4. Enable ESQL Syntax under Settings → Community plugins.

Query templates

FilePurpose
templates/getting-started.esqlFiltering and aggregation basics
templates/search.esqlFull-text search and score ordering
templates/threat-hunting.esqlECS-style process hunting

The plugin only highlights templates; it never executes them.

Privacy and security

ESQL Syntax runs locally. It makes no network requests, requires no account, reads no vault files, executes no queries, and includes no telemetry, analytics, advertisements, or payments. The plugin only registers language definitions with Obsidian's built-in highlighters; it never injects HTML or renders content itself.

Development

From a clean checkout, run the release checks in this order:

npm ci
npm run build
npm test
npm run verify:release

The production build creates ignored main.js. See docs/submission-checklist.md for the release and Community-directory process.

References

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.