function generate_location(tag, timestamp, record) if record["latitude"] ~= nil then record["location"] = record["latitude"] .. "," .. record["longitude"] end return 2, timestamp, record end