Thanks @skoelpin
I have tried this approch but still I am not be able to get desired outcome.
1. Outcome of first search is not been passed to second search properly.
This is how I am using my queries.
**first search output in table**
| table host_token service_earliest_time earliest latest time_token.earliest time_token.latest
**Second search**
| savedsearch "TEST_KPI_MTE_ALERT_FUNCTION" host_token="$host_token$" service_earliest_time="$service_earliest_time$" earliest="$earliest$" latest="$latest$" time_token.earliest="$time_token.earliest$" time_token.latest="$time_token.latest$"
Inspite arguments are not passed to second search, I can see second query is running but results are stored in "main" index in json format. which will be diffcult to parse. I was hopping to get results either via email or dumping in some file. extracting from logs will be difficult.
I am not sure if second search will use earliest and latest time from output of first search.
This is results what I am getting in logs (tokens not having values from first search)
{"messages": [{"type": "INFO", "text": "[subsearch]: Successfully read lookup file '/hp737srv2/apps/splunk/etc/apps/Murex/lookups/KPI_MASTER_LIST.csv'."}, {"type": "WARN", "text": "Unable to run query '| savedsearch KPI_MTE_NO_OF_CRITICAL_INFRA host_token= SERVICE_EARLIEST_TIME= time_token.earliest= time_token.latest= | appendcols [ | makeresults | eval Order=7 | fillnull count ] | table ALERT count Order '."}], "earliest": "1970-01-01T01:00:00.000+01:00", "description": "Splunk Adaptive Response Search", "latest": "2020-01-29T13:27:05.%L", "search": "| savedsearch \"TEST_KPI_MTE_ALERT_FUNCTION\" host_token=\"\" service_earliest_time=\"\" earliest=\"\" latest=\"\" time_token.earliest=\"\" time_token.latest=\"\"", "results": [{"TYPE": "MTE_GENERIC", "Category": "INFRA", "ALERT": "KPI_MTE_NO_OF_CRITICAL_INFRA", "Alert_Description": "Total No of Critical Alerts (INFRA)", "Dashboard": "MTE_ALERTS_CRITICAL_INFRA", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "INFRA", "ALERT": "KPI_EnvStatus_INFRA", "Alert_Description": "EnvStatus INFRA", "Dashboard": "MTE_envStatus_INFRA", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_MTE_RUNTIME_BA", "Alert_Description": "Business Activities Failed", "Dashboard": "MTE_RUNTIME_BA", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_MTE_RUNTIME_BA_EOD", "Alert_Description": "BA_EOD Failed Scripts", "Dashboard": "MTE_RUNTIME_BA_EOD", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_MTE_RUNTIME_TOOLING", "Alert_Description": "MTE RUNTIME TOOLING (Not Executed)", "Dashboard": "MTE_RUNTIME_TOOLING", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MX", "ALERT": "KPI_MTE_NO_OF_CRITICAL_MX", "Alert_Description": "Total No of Critical Alerts (MX)", "Dashboard": "MTE_ALERTS_CRITICAL_MX", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_MTE_NO_OF_CORES", "Alert_Description": "Total No of Cores", "Dashboard": "MTE_ALERTS_CORES", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_MTE_ALERT_RECIPIENT_COUNT", "Alert_Description": "MTE Alerts > 20 Per User", "Dashboard": "MTE_ALERT", "Threshold": "25"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_EnvStatus_MXTECH", "Alert_Description": "EnvStatus MXTECH", "Dashboard": "MTE_envStatus_MXTECH", "Threshold": "0"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_EnvStatus_LOAD", "Alert_Description": "EnvStatus LOAD (Value<=3)", "Dashboard": "MTE_envStatus_LOAD", "Threshold": "3"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_EnvStatus_BAU", "Alert_Description": "EnvStatus BAU (Value<=3)", "Dashboard": "MTE_envStatus_BAU", "Threshold": "3"}, {"TYPE": "MTE_GENERIC", "Category": "MTE", "ALERT": "KPI_EnvStatus_BP", "Alert_Description": "EnvStatus BP", "Dashboard": "MTE_envStatus_BP", "Threshold": "0"}]}
... View more