Farquhar pitched in eight games for the Chicago White Sox in 2018, allowing five earned runs in eight innings.
His last appearance came in the White Sox's 10-0 defeat to the Houston Astros on April 20. During the game, Farquhar collapsed in the dugout and was transported to a local hospital. The White Sox confirmed he had suffered a brain hemorrhage and was undergoing treatment at an intensive care unit.
Farquhar was released from the hospital in May, though his doctor told him to sit out the remainder of the 2018 season. The 31-year-old recovered enough to throw out the ceremonial first pitch before Chicago's June 1 game against the Milwaukee Brewers.
Taking a flier on the right-hander makes sense for the Yankees, who already had a loaded bullpen before signing Adam Ottavino to a three-year, $27 million deal.
Farquhar has a 3.93 ERA and a 3.60 FIP and is averaging 10.2 strikeouts per nine innings through the first seven years of his MLB career.