jt-glogarch ← Home GitHub

AI chat: ask Graylog in plain language

Ask a question the way you would ask a colleague. The model looks things up in Graylog through read-only tools, as your own Graylog account, and answers with the numbers Graylog computed. Every lookup is listed under the answer and opens in Graylog with one click. It runs on your own LLM server and is off by default.

What it does

A chat page in jt-glogarch, for people who know what they want to find out but not the query that finds it.

ΣExact numbers

Counts, top values, breakdowns by up to three fields and trends over time come from Graylog's aggregation API. The model reads the results; nothing is sampled.

⌕Right field first

Before it filters, it checks which fields the messages really have and where a word appears, with its exact value. A query that finds nothing is checked first.

☰Every lookup on show

Under each answer: the query, time range, records found and time taken, a copy button and a link that opens the same search in Graylog.

▦Dashboards, PDFs, cases

Turn an answer into a Graylog dashboard, a summary PDF whose charts are queried from Graylog again, or a case with the matching logs attached.

◫Pages and diagrams

An HTML dashboard or Mermaid diagram the model writes shows beside the chat as it is written, in a sandbox with no network.

⤳Attack paths, process trees

From one address: the hosts it got into and their later connections, up to six hops. A process tree shows what started what on Windows. Drawn from Graylog's counts.

⚇One person, every name

Accounts, e-mail addresses and UUIDs differ between systems. A question about a person searches all of their names, using the site's own lookup rules.

⇄Your own LLM servers

llama.cpp, vLLM, LM Studio, Ollama or any OpenAI-compatible server, and the Claude API. Set up several and pick one per question.

A question, the answer with its numbers, and the lookups behind it

Demo videos

Real questions on invented demo data: what was asked, what Graylog was asked, and the answer.

One user's trail across systems

PVE cluster troubleshooting

Mail troubleshooting

Investigating an intrusion

Tracing a service outage

Hardware faults and OOM

Account security audit

Spotting a network scan

Late-night outbound traffic spike

How it works

The model never talks to Graylog itself. It asks jt-glogarch to run a tool, and jt-glogarch decides whether and how.

One question, step by stepYouquestion, in any languageLLM serveryours, or the Claude APIAI chatbudgets · loop guard · pagingAnswerwith every lookup listedjt-glogarch toolscounts · aggregations · fieldsmcp_graylog toolsstreams · health · eventsGraylogas your accountOwn databaseincidents · archivesaskprompt + resultstool callsread onlychecked numbers
  1. You ask. The question goes to the LLM server you picked, with the list of tools it may use and the conversation so far (trimmed to the model's budget).
  2. The model asks for lookups. jt-glogarch runs each one against Graylog as you, checks its arguments against the tool's limits, and records it in the audit log.
  3. Results go back as data. They are wrapped so that text inside a log cannot pose as an instruction. A result too big for the model is kept and read page by page, never cut in half.
  4. Empty results are checked. When a lookup finds nothing, jt-glogarch tries a few cheap checks (unknown field, wrong case, the word is a value of another field) and hands the model the corrected query with its real count.
  5. The answer streams in. It keeps running if you leave the page, and you can stop it. A reply cut off by its length is continued; a model that starts repeating itself is stopped and asked once more.
While it works: each lookup with its time and result, and how long the answer has taken

The tools the model can use

Two groups: tools written in jt-glogarch, and the embedded mcp_graylog. The page shows each one by the name below.

Name in the pageFromWhat it is for
Counting and searching
Count messages
count_messages
jt-glogarchExact number of messages for a query and time range
Top values
top_values
jt-glogarchThe most common values of one field, with counts
Breakdown
aggregate
jt-glogarchGroup by 1 to 3 fields with counts, distinct counts, first and last time, sums, averages, percentiles; or by time
Find fields
find_fields
jt-glogarchWhich fields the messages have, the exact values of state fields, and where a word appears
Sample messages
sample_messages
jt-glogarchA few of the newest matching messages, to read what they look like
Message patterns
summarize_messages
jt-glogarchUp to 10,000 newest messages folded into patterns, each with a count
Read kept result
read_result
jt-glogarchReads more of a result that was too big to show at once
jt-glogarch's own data
Security incidents
list_security_incidents
jt-glogarchSecurity incidents found by jt-glogarch's detections
One incident
get_security_incident
jt-glogarchOne incident with its metrics, ATT&CK techniques and Graylog query
Investigation cases
list_security_cases
jt-glogarchInvestigations being worked on
One case
get_security_case
jt-glogarchOne investigation with its incidents and timeline
Risk ranking
security_risk_ranking
jt-glogarchAddresses and accounts ranked by risk, with how each point was counted
Archive coverage
archive_status
jt-glogarchHow archiving is doing: coverage, gaps, jobs, disk
Graylog configuration
List fields
list_fields
mcp_graylogFields Graylog knows
Streams
get_streams
mcp_graylogStreams
Inputs
list_inputs
mcp_graylogInputs
Index sets
list_index_sets
mcp_graylogIndex sets
Indices
list_indices
mcp_graylogIndices
System info
get_system_info
mcp_graylogGraylog version and node
Current time
get_current_time
mcp_graylogThe current time, for relative ranges
Graylog health
Cluster health
get_cluster_health
mcp_graylogCluster, journal and buffers
Node metrics
get_node_metrics
mcp_graylogNode metrics
Indexer failures
list_indexer_failures
mcp_graylogMessages OpenSearch refused to index
System notifications
list_system_notifications
mcp_graylogGraylog's own warnings
Silent sources
find_silent_sources
mcp_graylogSources that stopped sending
Alerts and events
Event definitions
list_event_definitions
mcp_graylogAlert rules
One event definition
get_event_definition
mcp_graylogOne alert rule
Search events
search_events
mcp_graylogAlerts that fired, up to 31 days
Event messages
get_event_source_messages
mcp_graylogThe messages behind an alert
Event notifications
list_event_notifications
mcp_graylogNotifications, without recipients or secrets
Dashboards, packs and analysis
Dashboards
list_dashboards
mcp_graylogDashboards
One dashboard
get_dashboard
mcp_graylogOne dashboard's widgets and queries
Content packs
list_content_packs
mcp_graylogContent packs installed
Log sample
get_log_sample
mcp_graylogA sample of messages
Search logs
search_logs_paginated
mcp_graylogSearch messages page by page
Time patterns
analyze_time_patterns
mcp_graylogMessages over time
Sources
analyze_source_distribution
mcp_graylogMessages per source
Field values
analyze_field_distribution
mcp_graylogValues of one field
Off unless an administrator ticks them
Log statistics
get_log_statistics
mcp_graylogOverview statistics
Error patterns
analyze_error_patterns
mcp_graylogError messages grouped
Log levels
get_log_level_analysis
mcp_graylogMessages per log level

Setting it up

Five steps, all on the AI chat page.

  1. Turn it on. Open the AI chat page, then AI settings, and tick Turn on AI chat.
  2. Add an LLM server. OpenAI-compatible: the server's URL (ending in /v1 for llama.cpp, vLLM, LM Studio, Ollama; OpenAI or Google Gemini work too, see the FAQ), an API key if it needs one, then pick the model from the list it returns. Claude API: an Anthropic key and a model. For a server you run, leave the context length at 0 and jt-glogarch asks the server.
  3. Set the limits. Tool rounds per question, the longest time range for tools that pull messages (24 hours by default; aggregations may cover 31 days), daily and monthly token limits for the site, per user and per server, and how long conversations are kept.
  4. Sign in with a Graylog account. The chat queries Graylog as the person asking. A Graylog login carries that identity; the local localadmin account is asked to sign in to Graylog on the page first.
  5. Optional. Allow an LLM outside your network (off by default, audited), turn on the MCP endpoint for external AI tools, AI analysis of security incidents, and the look of the summary PDF.

You need

  • A Graylog 6.x or 7.x server already configured in jt-glogarch
  • An LLM server that supports tool calls (function calling). Measured with Qwen running on the strata framework, 262,144-token context (GPU under Models and limits)
  • Signing in requires a Graylog role allowed by web.allowed_graylog_roles (Admin by default)
AI settings, grouped; each group folds
LLM servers: several at once, context length read from the server

How to ask

Any language works; the answer comes back in the language you asked in.

Questions that work well

  • Say the time. “in the last 24 hours”, “yesterday 09:00 to 12:00”. Without one, the model picks a short range.
  • Name the source. A host, a device, a product: “the firewall fw1”, “AdGuard on dns-01”.
  • Say the shape you want. “top 10 with counts”, “per hour”, “as a table”, “draw a timeline”, “make an HTML dashboard”.
  • Follow up. The conversation is kept, so “now only the blocked ones” works. Under the last answer are 2 or 3 suggested next questions; one click asks them.
  • Draw it. Under the last answer, besides the suggested questions, are up to three requests to draw the result as a chart, each a different kind (heatmap, scatter, links, percentiles, this period against the last). One click asks it.

Controls

  • LLM picker beside the input: which server answers (remembered in your browser). A label says whether log data stays inside your network.
  • Show thinking: shows a reasoning model's thinking while it works; folded otherwise, one click opens it.
  • Stop, answer again, edit and ask again. An answer keeps running when you leave the page; come back and it is there.
  • Prompt ideas: the light-bulb button left of Send opens common questions by topic and tips on asking; a click puts one in the box to adjust before sending.
  • When the model server is busy with someone else, the page says it is waiting for the server instead of looking stuck.

Examples

Under the last answer: suggested next questions, then chart ideas, each a different kind
Prompt ideas: common questions by topic and tips on asking; a click fills the box without sending

Reading an answer

The numbers come from Graylog, and every one of them can be checked there.

  • Lookups under each answer: the tool (by the name in the table above), its query, the absolute time range, how many records or rows, and how long it took.
  • Open in Graylog runs the same query over the same range in Graylog's search, so you can check any number yourself. Copy query copies it.
  • Check the conditions. A smaller model can drop a condition from a query. If a query lacks something you asked for, ask again or say which condition is missing.
  • Tables copy straight into a spreadsheet; a table with a time column also gets a timeline drawn beside it.
  • An answer cut short by the model's length limit is marked as such, never passed off as complete.

When a lookup finds nothing

In Graylog only message, full_message and source are matched word by word, ignoring case. Every other field must match its whole value, case included: measured on one site, action:blocked found 0 and action:Blocked 35,544 in a day. jt-glogarch checks an empty result before the model reads it and hands over the corrected query with its real count, so the model does not report “no records” when there are thousands.

The lookups behind an answer: Find fields checks how the site writes “blocked” before anything is counted, and each query opens in Graylog

People and hosts

Following one person's trail across systems, and turning internal addresses into hosts.

One person across systems

  • One person, every name. A person is jason in LDAP, jason@example.com in mail, EXAMPLE\jason in Windows and only a UUID in Nextcloud. jt-glogarch learns this from your own logs and searches all of them when the model searches one.
  • Read from your setup, not guessed. Fields are found by name in each product's convention; a UUID and its display name are linked only where your own pipeline rules look one up from the other. Fields that merely appear together, such as who acted and who it was done to, are never merged.
  • Never a namesake. jason does not match jason2, a jason at another company's domain, or a mail bounce address. Each step shows the names it added, and Security → Identities lets you confirm, reject or add names.

Who an address is

  • jt-ipam, when connected. An internal address in a log becomes a host: its name, owner, switch port and whether it can be reached from the internet. Ask “which computer is 10.0.20.55 and where is it?” and the answer comes from jt-ipam.
  • Your own networks. jt-ipam's subnets, your own public ranges included, count as internal in incidents; incidents name the host and the person behind an account.
  • Read-only and off by default. A key that can change data in jt-ipam is refused, and jt-ipam data is not sent to an LLM outside your network unless you allow it.
  • AI chat for more people. Graylog roles or users can be allowed AI chat only: they see that page, search with their own Graylog account and get only what Graylog lets them read.
Security → Identities: one name tried, every name found (a Nextcloud UUID through the site's own lookup), the fields per input, and a suggestion to confirm

Taking an answer further

An answer is a starting point: each of these is one click from it.

A Graylog dashboard

Create a Graylog dashboard under an answer lists the lookups that make charts. Pick them, the chart type and a time range; jt-glogarch creates a real dashboard in Graylog, as you. The widgets are live Graylog queries, not pictures. Only you can see it until you share it in Graylog.

A Graylog dashboard

A summary PDF

From the conversation header: a PDF report with the findings, conclusions and limits in the report's own words, and charts that are queried from Graylog again, so they agree with the dashboard. Numbers in the text that do not appear in the conversation or in the re-run results are flagged.

A summary PDF

HTML pages and diagrams

Ask for an HTML dashboard or a Mermaid diagram and it opens beside the chat while it is being written. The preview runs in a sandbox: it cannot reach the network, jt-glogarch or your cookies.

HTML pages and diagrams

An investigation case

Save as an investigation case creates an investigation with the conversation, each page or diagram the model drew, the lookups, the summary PDFs, and the matching logs of every lookup saved as compressed JSON with a SHA-256 checksum. A lookup the model ran twice is saved once.

An investigation case

Also

  • Download as Markdown: the whole conversation, with the lookups.
  • Copy an answer, a code block or a table.

Managing conversations

  • Conversations are listed by day (today, yesterday, last 7 days, older); up to 5 can be pinned to the top
  • Rename a conversation, search titles and message text, delete what you no longer need
  • Each person sees only their own conversations; conversations older than the retention setting are removed
  • Token use is counted per site, per user and per LLM server, with daily and monthly limits
The conversation list, grouped by day, with pins

For external AI tools: MCP

The same tools, for an AI client you already use.

  • Tick Turn on the MCP endpoint in the AI settings. External AI tools then reach the same read-only tools at https://<host>:8990/mcp (JSON-RPC: initialize, tools/list, tools/call).
  • The caller sends its own Graylog API token: Authorization: Bearer <token>. The token's user needs an allowed Graylog role. X-Graylog-Server picks the server when there are several.
  • 120 requests per minute per token, at most 20 calls per batch, every tool call audited.
# list the tools (replace the host and token)
curl -s https://jt-glogarch.example:8990/mcp \
  -H 'Authorization: Bearer <Graylog API token>' \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Security and privacy

What the model can reach, and what is kept.

  • Read only. No tool writes to Graylog. The only writes are the ones you click: a dashboard, a case.
  • Your own permissions. Lookups run as the signed-in Graylog user, so nobody sees streams their account cannot read.
  • Audited. Every question (first 200 characters) and every tool call with its arguments is in the audit log.
  • Your network by default. Only LLM servers inside your network are allowed until an administrator allows an external one; the page labels which kind answers.
  • Logs as data, not instructions. Tool results are wrapped and escaped before the model sees them.
  • Little kept. The conversation stores the questions, answers and a summary of each lookup (query, range, count), never the log lines. Kept results live in memory for 30 minutes.
  • Off by default. Upgrading never turns it on.

Models and limits

  • Any model with tool calls works; bigger and less quantized models drop fewer conditions. Measured: a 4-tool question took 47 s and matched a direct aggregation exactly; an HTML dashboard took about 2.5 minutes.
  • Measured on: GPU NVIDIA GeForce RTX 4060 Ti 16 GB, LLM server on the strata framework.
  • jt-glogarch reads the context length from the server and sizes everything to it: reply length, history, how many tools are offered, how big each result may be.
  • An LLM server with one slot answers one question at a time; others wait, and the page says so.
  • Tools that pull messages are limited to 24 hours by default; counts and aggregations go up to 31 days. A longer range is read over its last hours within the limit, and the step says so. Very large ranges are better as an aggregation than as messages.
  • A model can still be wrong. The lookups are listed so that you can check; for decisions, check the numbers in Graylog.

Questions

Can it change anything in Graylog?

No tool writes. A dashboard is created only when you click Create, as you.

Where do my logs go?

To the LLM server you picked: the question and the tool results. With an internal server they stay inside your network. jt-glogarch sends nothing anywhere else.

Can I trust the numbers?

Counts and breakdowns are computed by Graylog, not estimated by the model. Check that each query has your conditions; Open in Graylog shows the same search.

Why did it say there were no records?

Usually a field or its case: most fields match their whole value, case included. Open the lookup and look at its query; jt-glogarch now checks an empty result and offers the corrected query.

Do I need a GPU?

jt-glogarch does not; an LLM server you run yourself does, for useful speed. Without one, a cloud service works too: Claude with the type Claude API; OpenAI (the ChatGPT models) and Google Gemini with the type OpenAI-compatible and the URL https://api.openai.com/v1 or https://generativelanguage.googleapis.com/v1beta/openai, plus the service's API key. These are outside your network, so they need Allow an external LLM (outside the private network) (audited), and the questions and the log data the tools return go to that service. They do not tell jt-glogarch their context length: enter the model's in Context window.

Is it the same as mcp_graylog?

mcp_graylog is one of its two tool groups, embedded unmodified. The chat adds exact counting tools, field finding, jt-glogarch's own data, the page, and the exports.

Open full size
100%