@mayurr98 - Did one of the answers below help provide a solution your question? If yes, please click “Accept” below the best answer to resolve this post and upvote anything that was helpful. If no, please leave a comment with more feedback. Thanks.
Ultimately, the way to do this is to run a search that triggers a script (as an alert action). All the documentation supplied was tips about how to do this.
Here are a couple of scripts that people have posted: Generate SNMP trap from Splunk
But you could just google "python send snmp trap" (or your language of choice) for example scripts.