The undertaking mentioned in subsection (1) of section 25-1024 may, in vacation, be executed in the presence of the sheriff having the order of attachment in his or her hands, or, after the return of the order, before the clerk, with the same effect as if executed in court, the sureties in either case to be approved by the officer before whom the undertaking is executed.