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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...