Communicating between two pixhawks

I am working on formation flying, and need one Pixhawk to send attitude, GPS and some other data to the other Pixhawk using MAVlink. I know how to use Mission Planner or QGround to connect to a Pixhawk, but have no idea how to send data from one pixhawk to the other. I am fairly new to this matter, so any and every help is appreciated.

What data do you mean?

GPS co-ordinates, yaw, pitch, and roll angular velocities, altitude, etc.