Ruth Crawford Seeger (American Folk Songs for Children, 1948, page 71), cites Sandburg as her source, but lyrics and arrangement are different. She says it's from Texas.
BY'M BYE
By'm bye, By'm bye; Stars shining Number, number one, number two, number three, Good Lawd! By'm Bye, By'm Bye Good Lawd! By'm Bye.
Finger Play: "Number, number one, number two, number three" — continuing on up to five or ten or more, if desired — may be used as a finger play. Many things may be counted aside from stars and fingers, such as buttons on clothing, or children, or stair steps, or foolish things like shoes untied.
Tone Play: Children echo By'm Bye without being asked, and like to join in on the numbering phrase, especially if it is extended through a growing series of numbers.