Hi,
I've installed this app in my Splunk 6.2.3 instance running on Windows and have been able to use it to set up a few data inputs, for example here is one pulling in data using the flightaware.com FlightXML API - returns recent flight info for a particular aircraft 'ident':
[rest://FlightXML VH-FVF]
auth_password = ____________
auth_type = basic
auth_user = ________
endpoint = http://flightxml.flightaware.com/json/FlightXML2/FlightInfoEx
host = VH-FVF
http_method = GET
index = flightaware
index_error_response_codes = 0
polling_interval = 60
response_type = json
sourcetype = flightxml
streaming_request = 0
url_args = ident=VHFVF
I've got a few of these working - all the same except I've changed the host and url_args values. These are returning and indexing an array of flights.
I thought I'd have a go at setting up my own response handler to parse and split the array returned so that each element of the flights array is indexed individually. Somehow in doing this I think I've broken the one input in the example below, but all the others work ok still. I've tried removing and re-adding the input, reset $SPLUNKHOME$\etc\apps\rest_ta\bin\responsehandlers.py and $SPLUNKHOME$\etc\apps\rest_ta\bin\responsehandlers.pyc to default, restarted Splunk and even restarted the whole server but still no new events are getting indexed.
Can someone please offer some advice on how to troubleshoot this?
Also, I'd love some advice on how to create my own response handler to split the array. I'm new to python.
Here is an example of the raw output indexed at the moment in line with the input above:
{"FlightInfoResult":{"next_offset":15,"flights":[{"ident":"FD531","aircrafttype":"PC12","filed_ete":"01:21:00","filed_time":1432678027,"filed_departuretime":1432684800,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":170,"route":"DCT YTHI RIKAB N640 AD","actualdeparturetime":1432688340,"estimatedarrivaltime":1432690260,"actualarrivaltime":1432690360,"diverted":"","origin":"YTHI","destination":"YPAD","originName":"","originCity":"","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD531","aircrafttype":"PC12","filed_ete":"00:55:00","filed_time":1432678011,"filed_departuretime":1432679400,"filed_airspeed_kts":271,"filed_airspeed_mach":"","filed_altitude":180,"route":"DCT AD J15 YORKE","actualdeparturetime":1432680900,"estimatedarrivaltime":1432683480,"actualarrivaltime":1432683480,"diverted":"","origin":"YPAD","destination":"YTHI","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"","destinationCity":""},{"ident":"FD520","aircrafttype":"PC12","filed_ete":"00:41:00","filed_time":1432657590,"filed_departuretime":1432661700,"filed_airspeed_kts":266,"filed_airspeed_mach":"","filed_altitude":160,"route":"DCT REN V395 BLACK V454 AD","actualdeparturetime":1432662120,"estimatedarrivaltime":1432664460,"actualarrivaltime":1432664449,"diverted":"","origin":"YREN","destination":"YPAD","originName":"Renmark","originCity":"Renmark, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD520","aircrafttype":"PC12","filed_ete":"00:19:00","filed_time":1432657590,"filed_departuretime":1432658700,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":170,"route":"DCT AD V361 SEDAN V324 REN","actualdeparturetime":1432658520,"estimatedarrivaltime":1432660260,"actualarrivaltime":1432660260,"diverted":"","origin":"YPAD","destination":"YREN","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"Renmark","destinationCity":"Renmark, South Australia AU"},{"ident":"FD520","aircrafttype":"PC12","filed_ete":"00:19:00","filed_time":1432641249,"filed_departuretime":1432655400,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":170,"route":"DCT YTBB DCT RIKAB N640 AD","actualdeparturetime":1432651860,"estimatedarrivaltime":1432653720,"actualarrivaltime":1432653707,"diverted":"","origin":"YTBB","destination":"YPAD","originName":"Tumby Bay","originCity":"Tumby Bay, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD520","aircrafttype":"PC12","filed_ete":"01:00:00","filed_time":1432641231,"filed_departuretime":1432642200,"filed_airspeed_kts":271,"filed_airspeed_mach":"","filed_altitude":180,"route":"DCT AD J15 YORKE DCT","actualdeparturetime":1432643760,"estimatedarrivaltime":1432646340,"actualarrivaltime":1432646186,"diverted":"","origin":"YPAD","destination":"YTBB","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"Tumby Bay","destinationCity":"Tumby Bay, South Australia AU"},{"ident":"FD523","aircrafttype":"PC12","filed_ete":"02:00:00","filed_time":1432622082,"filed_departuretime":1432629900,"filed_airspeed_kts":270,"filed_airspeed_mach":"","filed_altitude":220,"route":"DCT MTG V259 AD","actualdeparturetime":1432633680,"estimatedarrivaltime":1432637400,"actualarrivaltime":1432637400,"diverted":"","origin":"YMTG","destination":"YPAD","originName":"Mount Gambier","originCity":"Mount Gambier, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD523","aircrafttype":"PC12","filed_ete":"00:49:00","filed_time":1432622082,"filed_departuretime":1432622700,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":230,"route":"DCT AD W519 MTG","actualdeparturetime":1432623283,"estimatedarrivaltime":1432626240,"actualarrivaltime":1432626240,"diverted":"","origin":"YPAD","destination":"YMTG","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"Mount Gambier","destinationCity":"Mount Gambier, South Australia AU"},{"ident":"FD523","aircrafttype":"PC12","filed_ete":"01:37:00","filed_time":1432606716,"filed_departuretime":1432611900,"filed_airspeed_kts":266,"filed_airspeed_mach":"","filed_altitude":150,"route":"DCT MARGO H84 AD","actualdeparturetime":1432616400,"estimatedarrivaltime":1432618140,"actualarrivaltime":1432618133,"diverted":"","origin":"YPIR","destination":"YPAD","originName":"Port Pirie","originCity":"Port Pirie, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD523","aircrafttype":"PC12","filed_ete":"00:42:00","filed_time":1432606716,"filed_departuretime":1432610100,"filed_airspeed_kts":242,"filed_airspeed_mach":"","filed_altitude":60,"route":"","actualdeparturetime":1432612260,"estimatedarrivaltime":1432612800,"actualarrivaltime":1432612800,"diverted":"","origin":"YBOC","destination":"YPIR","originName":"Booleroo Centre","originCity":"Booleroo Centre South Australia AU","destinationName":"Port Pirie","destinationCity":"Port Pirie, South Australia AU"},{"ident":"FD523","aircrafttype":"PC12","filed_ete":"00:57:00","filed_time":1432606716,"filed_departuretime":1432607400,"filed_airspeed_kts":271,"filed_airspeed_mach":"","filed_altitude":180,"route":"DCT AD","actualdeparturetime":1432609140,"estimatedarrivaltime":1432611300,"actualarrivaltime":1432611300,"diverted":"","origin":"YPAD","destination":"YBOC","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"Booleroo Centre","destinationCity":"Booleroo Centre South Australia AU"},{"ident":"FD512","aircrafttype":"PC12","filed_ete":"00:33:00","filed_time":1432522032,"filed_departuretime":1432530000,"filed_airspeed_kts":272,"filed_airspeed_mach":"","filed_altitude":200,"route":"DCT YKIG DCT RUVUS V259 AD","actualdeparturetime":1432529880,"estimatedarrivaltime":1432532340,"actualarrivaltime":1432532340,"diverted":"","origin":"YKIG","destination":"YPAD","originName":"Kingston","originCity":"Kingston, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD512","aircrafttype":"PC12","filed_ete":"00:33:00","filed_time":1432522032,"filed_departuretime":1432524600,"filed_airspeed_kts":272,"filed_airspeed_mach":"","filed_altitude":190,"route":"DCT AD W519 LRT DCT","actualdeparturetime":1432524863,"estimatedarrivaltime":1432526880,"actualarrivaltime":1432526880,"diverted":"","origin":"YPAD","destination":"YKIG","originName":"Adelaide Int'l","originCity":"Adelaide, South Australia AU","destinationName":"Kingston","destinationCity":"Kingston, South Australia AU"},{"ident":"FD536","aircrafttype":"PC12","filed_ete":"00:59:00","filed_time":1432278114,"filed_departuretime":1432292400,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":170,"route":"DCT WHA H84 AD","actualdeparturetime":1432294080,"estimatedarrivaltime":1432296300,"actualarrivaltime":1432296300,"diverted":"","origin":"YWHA","destination":"YPAD","originName":"Whyalla","originCity":"Whyalla, South Australia AU","destinationName":"Adelaide Int'l","destinationCity":"Adelaide, South Australia AU"},{"ident":"FD536","aircrafttype":"PC12","filed_ete":"01:15:00","filed_time":1432278114,"filed_departuretime":1432285200,"filed_airspeed_kts":269,"filed_airspeed_mach":"","filed_altitude":170,"route":"DCT PLC DCT WHA","actualdeparturetime":1432287922,"estimatedarrivaltime":1432290120,"actualarrivaltime":1432290120,"diverted":"","origin":"YPLC","destination":"YWHA","originName":"Port Lincoln","originCity":"Port Lincoln, South Australia AU","destinationName":"Whyalla","destinationCity":"Whyalla, South Australia AU"}]}}
I'd like to split out each 'flight' element and index them individually. Ideally the timestamp of each event would just be the time the event was indexed.
Thanks a lot!
... View more