Antennas on airliner wings?
You're very right. It's a static discharger or "static wick", and it is used to dissipate the static electricity accumulated during flight. The electrical buildup happens during flight through precipitation, clouds, dust, etc., and is known as "precipitation static".

Once the static reaches a certain point, it will discharge. Without wicks, this happens through antennae and can really mess with communications or navigation. Wicks make sure that process doesn't cause problems.