Splunk Search

How to use data models in subsearch

eidil
Explorer

I am trying to use data models in my subsearch but it seems it returns 0 results.

| datamodel disk_forecast C_drive search
| join type=inner host_name
[

| datamodel disk_forecast C_drive search
| search value > 80
| stats count by host_name
| lookup host_tier.csv host_name output host_name, tier
| search tier = G
| fields host_name
]
|timechart span=1d first(value) by host_name limit=0

I tried using normal searches to replace the data model and it worked fine. Is there any restriction of using datamodel in subsearch?

Tags (1)
0 Karma

eidil
Explorer

because i'm trying to get results based on host_name in host_tier.csv with gold tier SLA

0 Karma

richgalloway
SplunkTrust
SplunkTrust
I still don't see the need for a join. The subsearch is matching events from the exact same main search, keeping only the events from the subsearch (type=inner), so you should only need the subsearch.
---
If this reply helps you, Karma would be appreciated.
0 Karma

eidil
Explorer

This query is just a part of some more complex query. the subsearch will return specific host name while the  main search will search the disk space volume at a specified time.

0 Karma

richgalloway
SplunkTrust
SplunkTrust
Why are you joining a datamodel to itself? The result of the inner join should be the same as the subsearch.
---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Meet Splunk Observability Studio: AI-Assisted OpenTelemetry Instrumentation Without ...

Instrumentation is usually the last step or even an afterthought when building out a project. The feature ...

Federated Search for Cisco Security and Analytics Logging (SAL) is now GA on Splunk ...

Federated Search for Cisco  Security Analytics and Logging (SAL) is now generally available as part of the ...

Your Path to AgenticOps: AI Experiences for Every Splunk Practitioner

Your Path to AgenticOps: AI Experiences for Every Splunk Practitioner   Join us for a demo-driven look at how ...