The 31-year-old Swarzak is 4-3 with a career-low 2.23 ERA in 41 games this year. The right-hander got four outs for his first career save in Chicago's 3-1 victory over the Chicago Cubs on Monday.
The Brewers are fighting with the Cubs for the NL Central lead.
The rebuilding White Sox got minor league outfielder Ryan Cordell in the trade. The 25-year-old Cordell, an 11th-round draft pick by Texas in 2013, is batting .284 with 10 homers and 45 RBIs in 68 games with Triple-A Colorado Springs this year.
''We feel we picked up another interesting prospect in Ryan,'' Chicago general manager Rick Hahn said. ''Scouts are very enthusiastic about his ability, his diverse skillset. He's got some power, some speed, some versatility on the field, can play all three outfield positions, does have a history of playing some third base as recently as this year.''
Cordell has been on the disabled list with a back strain. Hahn said they plan to have him examined by their doctors in Chicago, and there is a chance he might not return until closer to instructional league. But Cordell is expected to be fine long-term, Hahn said.
AL-worst Chicago has been one of the majors' most active teams ahead of the July 31 non-waiver deadline. It traded Jose Quintana to the crosstown Cubs and shipped infielder Todd Frazier and relievers David Robertson and Tommy Kahnle to the Yankees.
More AP baseball: https://apnews.com/tag/MLBbaseball