I want to fetch table value for a search in Splunk via API in google script I wrote. Will be great of someone can share some info on how this can be achieved.
Custom searches are probably your best bet
https://docs.splunk.com/Documentation/Splunk/8.0.0/Search/Writeasearchcommand
https://www.youtube.com/watch?v=dc89nCWY35c