All Apps and Add-ons

Splunk add-on Builder: Why does the add-on complains when using pretrained sourcetypes in saved searches?

charliesfx
Explorer

I have the following saved search in a Technology Add-on built with the add on builder:
sourcetype=access_combined | stats count as metric_value by method, host

When I run the splunk add-on builder's validation, it warns against using underscores in sourcetype.

Is there a way to alias the access_combined source type to a name that will pass validation, but will still preserve the access_combined source type. Or is there a way to escape the _ so that validation won't complain?

0 Karma
1 Solution

lakshman239
Influencer

I believe Add-on builder uses the naming convention of using ":", e.g. vendor:mysourcetype, so it could complain. ]
In your props.conf, you could try something like to force to use rename [ not a good practice]
[access:combined]
rename = access_combined

View solution in original post

0 Karma

chli_splunk
Splunk Employee
Splunk Employee

I'm not sure what is "pretrained" sourcetype. Is it provided by Splunk? So you create an add-on without any data input & field extraction s but only saved search?
Firstly the best practice is from Splunk Add-on factory rather than AoB. AoB never creates any rules. That's the best practice how Splunk build add-ons in recent 4 years, and AoB helps your add-ons look like more "Splunk".
Secondly AoB is used to validate new sourcetypes you created in your case. If you are not the owner of the sourcetypes, please just ignore this warning, since it's not an error. Thanks.

0 Karma

charliesfx
Explorer

I'm trying to write searches against the built in "pretrained" source types. Almost all of the splunk pretrained sourcetypes have "_" in the name. Renaming is destructive beyond the plugin so I don't want to do that either. It seems odd that the built in source types directly contradict an add on builder "best practice".

0 Karma

chli_splunk
Splunk Employee
Splunk Employee

Yes this is just a naming rule of sourcetypes: use ":" instead of "_". If it's a legacy add-on, please ignore this warning since your data already indexed, or rename it in stanza as @lakshman239 mentioned

0 Karma

lakshman239
Influencer

I believe Add-on builder uses the naming convention of using ":", e.g. vendor:mysourcetype, so it could complain. ]
In your props.conf, you could try something like to force to use rename [ not a good practice]
[access:combined]
rename = access_combined

0 Karma
Get Updates on the Splunk Community!

Splunk is Nurturing Tomorrow’s Cybersecurity Leaders Today

Meet Carol Wright. She leads the Splunk Academic Alliance program at Splunk. The Splunk Academic Alliance ...

Part 2: A Guide to Maximizing Splunk IT Service Intelligence

Welcome to the second segment of our guide. In Part 1, we covered the essentials of getting started with ITSI ...

Part 1: A Guide to Maximizing Splunk IT Service Intelligence

As modern IT environments continue to grow in complexity and speed, the ability to efficiently manage and ...