Sprintf reference in grok pattern (help me~!)

Thank you for answer.
If so, is there any way to apply a different pattern to each filebeat without using an if statement?