Getting Data In

Splunk FOrwarder information in the API

akrai
New Member

I need to know if my asset/ hosts/devices has splunk forwarder installed . Which API would give me that information, and what would be the column name in that API.

Tags (1)
0 Karma
1 Solution

nabeel652
Builder

Not sure about an API but you could do a powershell script like this:

    $computers = "Computer1", "Computer2", "Computer3", "Computer4"


foreach ($computer in $computers){ 
    try {
        $result = Get-Service -ComputerName $computer | where {$_.Name -like "SplunkForwarder"}
    }
    catch {
        Write-Host "Some problem occured accessing" $computer -ForegroundColor Red
    }
    if ($result -ne $null) {
        Write-Host $computer "Has Splunk Forwarder Installed" -ForegroundColor Green
    }
    $result = $null
}

View solution in original post

0 Karma

nabeel652
Builder

Not sure about an API but you could do a powershell script like this:

    $computers = "Computer1", "Computer2", "Computer3", "Computer4"


foreach ($computer in $computers){ 
    try {
        $result = Get-Service -ComputerName $computer | where {$_.Name -like "SplunkForwarder"}
    }
    catch {
        Write-Host "Some problem occured accessing" $computer -ForegroundColor Red
    }
    if ($result -ne $null) {
        Write-Host $computer "Has Splunk Forwarder Installed" -ForegroundColor Green
    }
    $result = $null
}
0 Karma

akrai
New Member

Thanks for the response,, Appreciate it.. I am specifically looking for the API which can bring in the splunk forwarder information.
My usecase would be enterprise wide and would not be feasible to get a report for all the splunk forwarder information.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...