Name:Ollama Long-Running Inference Requests id:7619c98c-f53b-445f-87ca-b148e8560340 version:1 date:None author:Rod Soto, Nasreddine Bencherchali, Splunk status:production type:Anomaly Description:Identifies repeated Ollama inference requests with long response times on /api/generate, /api/chat, and /v1/chat/completions.
Long response time can result from model size, prompt length, host resources, or normal workload. GIN access logs do not include prompt content and cannot establish a prompt injection or jailbreak attempt, so use this as an exploratory performance signal. Data_source:
-Ollama Server
search:`ollama_server` "[GIN]"
| rex field=_raw "\|\s+(?<raw_status>\d+)\s+\|\s+(?<raw_latency>(?:\d+h)?(?:\d+m)?[\d\.]+(?:µs|ms|s))\s+\|\s+(?<raw_src>[^|]+?)\s+\|\s+(?<raw_method>\w+)\s+\"(?<raw_path>[^\"]+)\""
| stats count as long_request_count avg(response_time_seconds) as avg_response_time max(response_time_seconds) as max_response_time values(uri_path) as uri_path values(http_response_code) as status_codes by _time src host
how_to_implement:Ingest Ollama logs via Splunk TA-ollama add-on by configuring file monitoring inputs pointed to your Ollama server log directories (sourcetype: ollama:server), or enable HTTP Event Collector (HEC) for real-time API telemetry and prompt analytics (sourcetypes: ollama:api, ollama:prompts). CIM compatibility using the Web datamodel for standardized security detections. known_false_positives:Legitimate complex queries requiring extensive model reasoning, large context windows processing substantial amounts of text, batch processing operations, or resource-constrained systems experiencing performance degradation may trigger this detection during normal operations. References: -https://github.com/rosplk/ta-ollama -https://github.com/OWASP/www-project-ai-testing-guide drilldown_searches: name:'View the detection results for - "$src$"' search:'%original_detection_search%
| search src="$src$"' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' name:'View risk events for the last 7 days for - "$src$"' search:'from datamodel Risk.All_Risk
| search normalized_risk_object IN ("$src$")
| stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`' earliest_offset:'7d' latest_offset:'0' analytic_story:['Suspicious Ollama Activities']