Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json log using multiline exception #32971

Closed
Iatbzh opened this issue Sep 5, 2022 · 9 comments
Closed

json log using multiline exception #32971

Iatbzh opened this issue Sep 5, 2022 · 9 comments
Labels
needs_team Indicates that the issue/PR needs a Team:* label request-discuss Label added to request the creator to create a topic in discuss Stalled

Comments

@Iatbzh
Copy link

Iatbzh commented Sep 5, 2022

log:
{"message":"","thread":"cccccccf1-d147-ccc-cccccd-0cccccccccccc9","pageSysId":"64","href":"http://tset/test?from=%2test","pageSpDomain":"","@timestamp":"2022-09-03T15:29:54.272Z","time":"2022-09-03 15:29:54.271","level":"INFO","container":{"image":{"name":"test:test"},"id":"cccccccccccccccccccccccccccccccctteateststset"}}

filebeat config:
`filebeat.autodiscover:
providers:

  • type: kubernetes
    #scope: cluster
    node: ${NODE_NAME}
    #unique: true
    templates:
  • condition:
  • contains:
    kubernetes.namespace: "sup"
    config:
  • type: container
    paths:
  • /var/log/containers/*${data.kubernetes.container.id}.log
    multiline:
    type: pattern
    pattern: '^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}\s'
    negate: true
    match: after
    max_lines: 20000
    processors:

drop_fields:
fields:

  • host.name
  • ecs
  • log
  • agent
  • input
  • stream
  • thread
  • kubernetes.node.labels
  • kubernetes.node.uid
  • kubernetes.node.hostname
  • kubernetes.replicaset
  • kubernetes.namespace_uid
  • kubernetes.labels.pod-template-hash
  • container.runtime
    ignore_missing: true
    output.kafka:
    hosts: [test1:9092,test2:9092,test3:9092]
    topic: test
    partition.round_robin:
    reachable_only: false
    required_acks: 1
    compression: gzip
    max_message_bytes: 4194304`
    Result: This log will not be collected
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 5, 2022
@botelastic
Copy link

botelastic bot commented Sep 5, 2022

This issue doesn't have a Team:<team> label.

@mtojek
Copy link
Contributor

mtojek commented Sep 5, 2022

Hi @Iatbzh! Please format your issue first using code tags to be clear about what is it.

@Iatbzh
Copy link
Author

Iatbzh commented Sep 6, 2022

Sorry, I need to get a new code?

@Iatbzh
Copy link
Author

Iatbzh commented Sep 6, 2022

filebeat config: filebeat.autodiscover:
providers:

type: kubernetes
#scope: cluster
node: ${NODE_NAME}
#unique: true
templates:
condition:
contains:
kubernetes.namespace: "sup"
config:
type: container
paths:
/var/log/containers/*${data.kubernetes.container.id}.log
multiline:
type: pattern
pattern: '^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}\s'
negate: true
match: after
max_lines: 20000
processors:
drop_fields:
fields:

host.name
ecs
log
agent
input
stream
thread
kubernetes.node.labels
kubernetes.node.uid
kubernetes.node.hostname
kubernetes.replicaset
kubernetes.namespace_uid
kubernetes.labels.pod-template-hash
container.runtime
ignore_missing: true
output.kafka:
hosts: [test1:9092,test2:9092,test3:9092]
topic: test
partition.round_robin:
reachable_only: false
required_acks: 1
compression: gzip
max_message_bytes: 4194304``

@Iatbzh
Copy link
Author

Iatbzh commented Sep 6, 2022

My problem is: when I use auto discovery to collect business container logs, the json log that takes up two lines cannot be collected

@mtojek
Copy link
Contributor

mtojek commented Sep 6, 2022

As I said, please reformat your post using code tags.

@endorama
Copy link
Member

Hello @Iatbzh, in order for us to follow up this issue we need it to be clearer than what it is now.

To help us debug this, please format your posts using the appropriate formatting; here is a link to the GitHub docs about formatting code.

You may want to refer at the documentation for handling multiline in filebeat and explain what is the bug here.
Please note that we use this issue tracker only for bugs and don't answer usage question here, if it's not a bug or you are unsure about it please ask this question on our Elastic Discuss forum first.

Thank you!

@kaiyan-sheng kaiyan-sheng added the request-discuss Label added to request the creator to create a topic in discuss label Nov 28, 2022
@botelastic
Copy link

botelastic bot commented Nov 28, 2022

Thank you very much for creating this issue. However, we would kindly like to ask you to post all questions and issues on the Discuss forum first. In addition to awesome, knowledgeable community contributors, core Beats developers are on the forums every single day to help you out as well. So, your questions will reach a wider audience there, and if we confirm that there is a bug, then you can reopen this issue with the new information or open a new one.

@botelastic
Copy link

botelastic bot commented Nov 28, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Nov 28, 2023
@botelastic botelastic bot closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label request-discuss Label added to request the creator to create a topic in discuss Stalled
Projects
None yet
Development

No branches or pull requests

4 participants