Is the equivalent, a script as an event source for an input.
You can also run your script on a cron and have it push data into metricbeat http module, check the module doc for more details.
You can also run your script on a cron and have it write the output to a file that filebeat monitors and harvest.
You don't store that script indexed in ES... I don't see what would be the point of doing this anyway and that Splunk feature doesn't do that either, the script is an input config, not an indexed payload in the search engine.