Logtash adding filename as index name

grok { match => [ "path", "/(?<filename>[^/]+).json" ] }

will pull out the filename, then you can reference it using 'index => "%{filename}"'.