Splunk Search

Two Nearly Identical Inputs But One Doesnt Work (PowerShell)

JordanPeterson
Path Finder

So I have the two below in my inputs.conf the top one works, the bottom one does not. Both commands work fine when ran on the machines the forwarders are on. I cannot find any differences that I could be missing. Thoughts?

[powershell://Get-ClusterGroup]
script = Get-ClusterGroup | Select Name,OwnerNode,State
schedule = 0 */5 * * *
index = pod-db
disabled = 0
sourcetype = Get-ClusterGroup

[powershell://Get-ClusterNode]
script = Get-ClusterNode | Select Name,ID,State
schedule = 0 */5 * * *
index = pod-db
disabled = 0
sourcetype = Get-ClusterNode

In fact I know they are identical because I did a yank and put in vim to duplicate the top one that works. There is nothing unusual in the splunk-powershell.ps1.log file on the forwarder machine.

Tags (1)
0 Karma
1 Solution

JordanPeterson
Path Finder

Alright, not sure why this worked buy I dropped the "Get-" from Get-ClusterNode in the source and sourcetype and it works. I'm not sure why that's the case but apparently it is.

View solution in original post

0 Karma

JordanPeterson
Path Finder

Alright, not sure why this worked buy I dropped the "Get-" from Get-ClusterNode in the source and sourcetype and it works. I'm not sure why that's the case but apparently it is.

0 Karma

jconger
Splunk Employee
Splunk Employee

When you say the top one works but the bottom one doesn't, are you just not seeing data for the sourcetype in the pod-db index? Or, do you see some type of error?

Nothing jumps out as wrong in your inputs.conf though. Maybe some setting somewhere else is interfering? My personal next step would be btool to check the expanded inputs.conf -> https://docs.splunk.com/Documentation/Splunk/7.1.0/Troubleshooting/Usebtooltotroubleshootconfigurati...

Something like the following:

./splunk cmd btool inputs list --debug
0 Karma

JordanPeterson
Path Finder

I'm seeing data for one but not the other. No errors I can find. Here's the btool results from that section. Still looks nearly identical. cwdbsql011-01 is the forwarder machine.

D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  [powershell://Get-ClusterGroup]
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  disabled = 0
host = cwdbsql011-01
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  index = pod-db
D:\Program Files\Splunk\etc\system\default\inputs.conf                             interval = 60
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  schedule = 0 */5 * * *
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  script = Get-ClusterGroup | Select Name,OwnerNode,State
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  sourcetype = Get-ClusterGroup
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  [powershell://Get-ClusterNode]
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  disabled = 0
host = cwdbsql011-01
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  index = pod-db
D:\Program Files\Splunk\etc\system\default\inputs.conf                             interval = 60
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  schedule = 0 */5 * * *
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  script = Get-ClusterNode | Select Name,ID,State
D:\Program Files\Splunk\etc\apps\sql_monitoring\local\inputs.conf                  sourcetype = Get-ClusterNode
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!

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

All Work and No Play? Not at .conf26! Unwind at These Evening Events

Between hands-on technical sessions, keynote reveals, and diving into live architectures, .conf26 is packed ...

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...