The incident happened between 11.30am and 12pm on Friday 1st March on the public footpath between Newbigging and Stoneybank.
The man was walking in the area when he was attacked and sustained an injury to his abdomen and arm.
He attended at the Royal Infirmary of Edinburgh where he was treated and later released.
Inquiries are ongoing to identify those responsible and anyone with information is asked to come forward.
Detective Constable Kimberley Allan from Lothians and Scottish Borders CID said: “Fortunately the victim’s injuries were not too serious, or this could have been a very different investigation.
“At this time we don’t have a description or any details of those responsible.
“As such, we are keen to hear from anyone who remembers seeing any suspicious activity in the area that attack took place on Friday afternoon.
“Likewise, any members of the public with any other relevant information, including details of those responsible for the assault, are urged to contact police immediately.”
Those with information can contact Lothians and Scottish Borders CID via 101 and quote incident number 2826 of the 1st March. Alternatively, an anonymous report can be made to the charity Crimestoppers on 0800 555 111.