The incident happened between 11:30am and noon on Friday 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.”
The stabbing was one of three reported in the Lothians in the space of 48 hours.
Outlander actor Tam Dean Burn was attacked just off the Royal Mile on Saturday afternoon, while there was a separate stabbing in Bingham Park on Sunday.
Those with information can contact Lothians and Scottish Borders CID via 101. Alternatively, an anonymous report can be made to the charity Crimestoppers on 0800 555 111.