Hi, I would like to know how to read data from rest API. For example, I have a splunk rest endpoint:
curl -k -u admin:oracle_4U
https://localhost:8089/services/search/v2/jobs/1674187705.76/events --get -d output_mode=json
Sample: (content below is irrelevant, it just show end port works and I got a json output)
[oracle@down2 admin]$ curl -k -u admin:oracle_4U https://localhost:8089/services/search/v2/jobs/1674187705.76/events --get -d output_mode=json
{"preview":false,"init_offset":0,"messages":[],"fields":[{"name":"_bkt"},{"name":"_cd"},{"name":"_indextime"},{"name":"_raw"},{"name":"_serial"},{"name":"_si"},{"name":"_sourcetype"},{"name":"_subsecond"},{"name":"_time"},{"name":"host"},{"name":"index"},{"name":"linecount"},{"name":"source"},{"name":"sourcetype"},{"name":"splunk_server"}],"results":[{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:23","_indextime":"1669941506","_raw":"12/2/2022 11:45:00.000 AM,6,world","_serial":"0","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-02T11:45:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"},{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:17","_indextime":"1669941506","_raw":"12/2/2022 11:35:00.000 AM,4,bar","_serial":"1","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-02T11:35:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"},{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:20","_indextime":"1669941506","_raw":"12/2/2022 11:15:00.000 AM,5,hello","_serial":"2","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-02T11:15:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"},{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:14","_indextime":"1669941506","_raw":"12/2/2022 11:15:00.000 AM,3,foo","_serial":"3","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-02T11:15:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"},{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:11","_indextime":"1669941506","_raw":"12/1/2022 11:25:00.000
AM,2,jen","_serial":"4","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-01T11:25:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"},{"_bkt":"main~0~2DA1E607-D0B1-4118-8518-6599FD111AAC","_cd":"0:8","_indextime":"1669941506","_raw":"12/1/2022 11:15:00.000 AM,1,po","_serial":"5","_si":["down2","main"],"_sourcetype":"csv","_subsecond":".000","_time":"2022-12-01T11:15:00.000-05:00","host":"down2","index":"main","linecount":"1","source":"xx.csv","sourcetype":"csv","splunk_server":"down2"}], "highlighted":{}}[oracle@down2 admin]$
[oracle@down2 admin]$
I leaned that we have utl_http that can perform this type of task, but is it not clear to me:
1.) Do I need the wallet to import the self-signed certificate to get the above https to work.
2.) How do I pass the extra argunment, i.e., " --get -d output_mode=json" using utl_http.
Thank you.