LOGDETECTIVE(1)
π LOGDETECTIVE(1) π
okay bestie, gather round, because we're about to talk about logdetective β it lives in the User Commands section of the manual, and it is genuinely one of the most useful little gremlins you'll ever meet. no cap. π΅οΈβοΈβ¨
β¨ NAME β¨
logdetective β analyze and summarize log files using LLM and Drain templates π§
πΈ SYNOPSIS πΈ
logdetective [OPTIONS] file
π DESCRIPTION π
so logdetective is a tool that analyzes log files with a LLM using the Drain log template miner. it's giving detective energy fr fr. π΅οΈ
it can consume logs from a local path or a URL, summarize them, and cluster them so inspecting them is way easier. main character tool behaviour honestly. π
π POSITIONAL ARGUMENTS π
fileβ the URL or path to the log file you want analyzed. that's the one, bestie, that's the snack. π
β¨ OPTIONS β¨
-h,--helpβ show the usage description and dip. bye! π-M MODEL,--model MODELβ the path to the language model for analysis, if you've got it stored locally. you can also just specify the model by name based on the repo on Hugging Face (peep the Examples section, i gotchu). the repo id has to be in the form'namespace/repo_name'. and since we're using LLama.cpp, we want this in the gguf format. bonus: if the model is already on your machine, it will skip the download entirely. slay. (optional, default:"fedora-copr/granite-3.2-8b-instruct-GGUF") πΎ-F FILENAME_SUFFIX,--filename-suffix FILENAME_SUFFIXβ defines the suffix of the model file name to retrieve from Hugging Face. β οΈ this option only applies when the model is specified by its Hugging Face repo name, and not by its path. (defaultQ4_K.gguf)-n,--no-streamβ disables streaming output of the analysis results. no drip-feed, just the whole thing at once. π«π-C N_CLUSTERS,--n-clusters N_CLUSTERSβ number of clusters to use with the Drain summarizer. (optional, default8) ποΈ-v,--verboseβ enables verbose output during processing. and listen, you can go-vvor-vvvfor higher levels of verbosity. go feral. π£οΈ-q,--quietβ suppresses non-essential output. shhh. π€«--prompts PROMPTS_FILEβ (β οΈ Deprecated, replaced by--prompts-configand--prompt-templates) path to a prompt configuration file where you can customize (aka override the default) prompts sent to the LLM. for reference, look athttps://github.com/fedora-copr/logdetective/blob/main/logdetective/prompts.yml.
prompts need to have a form compatible with Python format string syntax (see https://docs.python.org/3/library/string.html#format-string-syntax) with spaces, or replacement fields marked with curly braces, {}, left for insertion of snippets. the number of replacement fields in new prompts must be the same as in the original, though their position may be different. π
--temperature TEMPERATUREβ temperature for inference. higher temperature leads to more creative and variable outputs, i.e. the model gets a little unhinged (affectionate). (default0.8) π‘οΈ--csgrepβ usecsgrepto process the log before analysis. when you're working with logs containing messages from GCC, it can be beneficial to employ an additional extractor based on thecsgreptool, to make sure the messages are kept intact. and sincecsgrepis not available as a Python package, it has to be installed separately β with a package manager, or fromhttps://github.com/csutils/csdiff. π¦--skip-snippets SNIPPETS_FILEβ path to patterns for skipping snippets. you can specify regular expressions matching log chunks (the ones that maybe don't contribute to analyzing the problem), along with a simple description. patterns to be skipped must be defined in a yaml file as a dictionary, where the key is a description and the value is a regex. π§Ή
examples:
contains_capital_a: "^.*A.*"
starts_with_numeric: "^[0-9].*"
child_exit_code_zero: "Child return code was: 0"
--prompts-config PROMPTSβ path to a prompt configuration file where you can customize (override the default) prompts sent to the LLM and set optional configuration. reference athttps://github.com/fedora-copr/logdetective/blob/main/logdetective/prompts.yml. βοΈ--prompt-templates TEMPLATE_DIRβ path to the prompt template dir. prompts must be valid Jinja templates, and system prompts must include the fieldsystem_time. π§΅
π EXAMPLES π
example usage:
$ logdetective https://example.com/logs.txt
or, if the log file is stored locally:
$ logdetective ./data/logs.txt
analyze a local log file using an LLM found locally:
$ logdetective -M /path/to/llm /var/log/syslog
with a specific model from HuggingFace (namespace/repo_name β and note that --filename-suffix is also needed here, don't forget it bestie):
$ logdetective https://example.com/logs.txt --model QuantFactory/Meta-Llama-3-8B-Instruct-GGUF --filename-suffix Q5_K_S.gguf
cluster logs from a URL (using Drain):
$ logdetective -C 10 https://example.com/logs.txt
π¦ SEE ALSO π¦
π ADDITIONAL NOTES π
note that logdetective works as intended with instruction tuned text generation models in GGUF format. like, that's the vibe check it needs to pass. β
and that's the whole page, bestie!! π«Ά this was logdetective 1.0, dated 07/29/2026 β go analyze some logs and slay π
β¨π
π¦ where this page comes from
- fedora 44: python3-logdetective 3.5.0-2.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms