# How to apply filebeat to openshift and make use of multiline

**URL:** <https://discuss.elastic.co/t/how-to-apply-filebeat-to-openshift-and-make-use-of-multiline/284528>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [September 18, 2021, 6:18am UTC](https://discuss.elastic.co/t/how-to-apply-filebeat-to-openshift-and-make-use-of-multiline/284528 "2021-09-18T06:18:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsy1990](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lsy1990/32/94742_2.png) [@lsy1990](https://discuss.elastic.co/u/lsy1990)\
**Post date:** [September 18, 2021, 6:18am UTC](https://discuss.elastic.co/t/how-to-apply-filebeat-to-openshift-and-make-use-of-multiline/284528/1 "2021-09-18T06:18:04Z")

</div>

I deploy filebeat to openshift 3.11 by daemonset .The log format is json like this below:  
{"log":"\u0009at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)\n","stream":"stderr","time":"2021-09-18T05:57:04.787203348Z"}  
{"log":"\u0009at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n","stream":"stderr","time":"2021-09-18T05:57:04.787237471Z"}  
{"log":"\u0009at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)\n","stream":"stderr","time":"2021-09-18T05:57:04.787262424Z"}

and my config is below：  
filebeat.config:  
inputs:  
# Mounted `filebeat-inputs` configmap:  
path: ${path.config}/inputs.d/_.yml  
# Reload inputs configs as they change:  
reload.enabled: false  
modules:  
path: ${path.config}/modules.d/_.yml  
# Reload module configs as they change:  
reload.enabled: false

# Uncommnet this part and remove `filebeat.config.inputs` when running in Openshift and cri-o

filebeat.autodiscover:  
providers:  
- type: kubernetes  
include\_pod\_uid: true  
hints.enabled: true  
templates:  
- condition.regexp:  
kubernetes.container.name: '.+'  
config:  
- type: docker  
containers:  
path: "/var/log/pods/\*${data.kubernetes.pod.uid}/"  
ids:  
- "${data.kubernetes.container.name}"  
multiline:  
pattern: '^[[0-9]{4}-[0-9]{2}-[0-9]{2}'  
negate: true  
match: after  
json:  
message\_key: log

# To enable hints based autodiscover, remove `filebeat.config.inputs` configuration and uncomment this:

#filebeat.autodiscover:

# providers:

# - type: kubernetes

# hints.enabled: true

processors:

- add\_cloud\_metadata:

as you know，multiline can't work。  
Is there some config need to modify？  
thanks a lot

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 16, 2021, 8:18am UTC](https://discuss.elastic.co/t/how-to-apply-filebeat-to-openshift-and-make-use-of-multiline/284528/2 "2021-10-16T08:18:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
