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

OpenSearch log issue #111

Open
DIEN227 opened this issue Jul 24, 2023 · 0 comments
Open

OpenSearch log issue #111

DIEN227 opened this issue Jul 24, 2023 · 0 comments

Comments

@DIEN227
Copy link

DIEN227 commented Jul 24, 2023

Hi I have OpenSearch 2.5, Fluentd (fluentd-kubernetes-daemonset:v1.16-debian-opensearch-1) and Kibana. I want within fields in Kibana -> field for every label which exists in my pods. Problem is that it still give me just kubernetes.labels.app and I need all values from labels not just app (kubernetes.labels.*).

I have problem with this part of code and I knew that :

      @type record_transformer
      enable_ruby
      <record>
        kubernetes ${record[“kubernetes”].merge(“labels” => {“app” => record.dig(“kubernetes”, “labels”, “app”) || record.dig(“kubernetes”, “labels”)})}
        log_type ${record.dig("kubernetes", "annotations", "fluentd_log_type") or record.dig("kubernetes", "labels", "app") or "none"}
        prefix app-${record.dig("kubernetes", "annotations", "fluentd_log_type") or record.dig("kubernetes", "labels", "app") or record.dig("kubernetes", "labels", "k8s-app") or "none"}
        pod_id ${record.dig("kubernetes", "pod_id") or "none"}
        old_tag ${tag}
        traceId ${ s = record['log'][/traceId \w{16}./]; s ? s.split(' ')[-1] : nil }
      </record>
    </filter>```

Specifically here:

`kubernetes ${record[“kubernetes”].merge(“labels” => {“app” => record.dig(“kubernetes”, “labels”, “app”) || record.dig(“kubernetes”, “labels”)})}`

Without this it used to give me error 400 - Rejected by OpenSearch. And after it, It gives me just kubernetes.labels.app but not all values as  field what I want.

Thank you
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant