Getting Data In

How do you refresh programmatically created Input configurations?

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.

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

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