We attached a 2x4 to the brick wall, and attached that way.  Love the look of the mantle.  The first one arrived damaged, but Wayfair's amazing customer service dealt with that quickly and to our satisfaction.  From the top and bottom, you can tell it is not a solid piece, but not from the front or sides. The back is hollow, so we attached a board to the brick, then the mantle to the board.  It is sturdy, and hold the small amount of weight we will put on it.