Every language you feel comfortable with has an OSM pbf file reader.
I’m using OSMSharp: http://www.osmsharp.com/ to extract the data and insert it to Elasticsearch using the following code:
https://github.com/IsraelHikingMap/Site/blob/master/IsraelHiking.DataAccess/OpenStreetMap/OsmRepository.cs
https://github.com/IsraelHikingMap/Site/blob/master/IsraelHiking.API/Converters/OsmGeoJsonConverter.cs