How do I extract partial fields from log.file.path

for example
log.file.path:/data/logs/service-name/service-name.log
I want to extract the service-name of log.file.path as a tags ,How to configure filebeat.yml