Getting Data In

How do you refresh programmatically created Input configurations?

DavidGirsvaldas
Explorer

Hi,

Im creating new configurations for ModularInput using C# SDK. This is how I do it:

service.Configurations.GetAllAsync();
service.Configurations.Where(x => x.Name == "inputs").SingleOrDefault();
Configurations.CreateAsync("myModularInputName");
Configurations.UpdateAsync("myModularInputName", myModInputArguments);

This code works. Configurations get created and are visible in Splunk files and the UI. However, ExecProcessor will not use the new configuration to start streaming it unless I explicitly refresh it. For example, all it takes for me to refresh it is to open newly created config in Splunk UI and click "save" on it, even without making any edits. Something gets called in Splunk behind the scenes which causes newly created config to get executed.

Some things I tried to far are calling "https://localhost:8089/services/apps/local/myModularInputName?refresh=true", however this restarted ALL "myModularInputName" configurations, instead of just newly created one.

I tried calling "https://localhost:8089/servicesNS/nobody/system/data/inputs/myModularInputName/myNewConfig/_reload", but it doesn't do anything.

Thank you for your attention.

chrisyounger
SplunkTrust
SplunkTrust

You need to Make a POST call to the debug/refresh endpoint, specifically this one:

https://__SPLUNKURL__/en-GB/debug/refresh?entity=admin/conf-inputs

All the best!

0 Karma

DavidGirsvaldas
Explorer

thank you for your input.
However refreshing given endpoint does refresh all of the inputs, instead of a specific one. I managed to solve my problem by enabling my new configuration at endpoint /servicesNS/nobody/system/data/inputs/myModualrInput/myNewConfig/enable

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...