I ended up using another plugin to rewrite the tag (rewrite_tag_filter), and then used the tag:
<source>
@type tail
path /mnt/nomad/alloc/*/alloc/logs/*
path_key tailed_path
pos_file /var/log/fluentd/nomad_log.pos
<parse>
@type none
</parse>
tag s3.nomad
</source>
<filter s3.nomad>
type record_transformer
enable_ruby
<record>
log_file "${record['tailed_path']}"
hostname "${hostname}"
tailed_path ${File.basename(record["tailed_path"]).sub(/(?<=.)\..*/, '')}
</record>
</filter>
<match s3.nomad>
@type rewrite_tag_filter
<rule>
key tailed_path
pattern /(.*)/
tag service.$1
</rule>
</match>
<match service.*>
@type s3
aws_key_id foo
aws_sec_key bar
s3_bucket enverus-ea-log-archive-dev
path "nomad-logs/%Y/%m/%d/${tag}/"
<buffer tag,time>
@type file
path /var/log/fluentd
timekey 120
timekey_wait 30s
chunk_limit_size 256m
</buffer>
time_slice_format %Y%m%d%H
</match>