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

Create a destination file with name derived from OTel log attribute #5705

Closed
smoms opened this issue Jun 20, 2024 · 3 comments
Closed

Create a destination file with name derived from OTel log attribute #5705

smoms opened this issue Jun 20, 2024 · 3 comments
Labels
question Further information is requested

Comments

@smoms
Copy link

smoms commented Jun 20, 2024

How to create a destination file with name derived from OTel log attribute using OTel Contrib and/or FLuentBit in K8s?

Hi,
we have an OTel log format like this:

{
	"@timestamp": "2024-05-02T06:12:15.673710Z",
	"log": {
		"resourceLogs": [
			{
				"resource": {
					"attributes": [
						{
							"key": "service.name",
							"value": {
								"stringValue": "yyy"
							}
						},
						{
							"key": "service.namespace",
							"value": {
								"stringValue": "xxx"
							}
						},
						{
							"key": "service.version",
							"value": {
								"stringValue": "1.0.0"
							}
						},
						{
							"key": "service.instance.id",
							"value": {
								"stringValue": "2ccbad07-5c95-48a9-be9b-0afe87570fc3"
							}
						},
						{
							"key": "telemetry.sdk.name",
							"value": {
								"stringValue": "opentelemetry"
							}
						},
						{
							"key": "telemetry.sdk.language",
							"value": {
								"stringValue": "dotnet"
							}
						},
						{
							"key": "telemetry.sdk.version",
							"value": {
								"stringValue": "1.7.0"
							}
						}
					]
				},
				"scopeLogs": [
					{
						"scope": {
							"name": "xxx"
						},
						"logRecords": [
							{
								"timeUnixNano": "1714630307647565200",
								"observedTimeUnixNano": "1714630307647565200",
								"severityNumber": 9,
								"severityText": "Information",
								"body": {
									"stringValue": "RequestnMethod: GETnPath: /v1/user_profiles/e8c9f684-e0d4-4ef8-82e9-0663a7bb419cn"
								},
								"attributes": [
									{
										"key": "{OriginalFormat}",
										"value": {
											"stringValue": "{body}"
										}
									},
									{
										"key": "eventSubjectId",
										"value": {
											"stringValue": "e8c9f684-e0d4-4ef8-82e9-0663a7bb419c"
										}
									},
									{
										"key": "eventEntityId",
										"value": {
											"stringValue": "e8c9f684-e0d4-4ef8-82e9-0663a7bb419c"
										}
									},
									{
										"key": "eventType",
										"value": {
											"stringValue": "UserProfile"
										}
									},
									{
										"key": "eventAction",
										"value": {
											"stringValue": "Read"
										}
									},
									{
										"key": "logType",
										"value": {
											"stringValue": "Audit"
										}
									},
									{
										"key": "businessTxKeyDepartmentId",
										"value": {
											"stringValue": "5fc60188-f0fd-4b7f-837f-e1fca2e84442"
										}
									},
									{
										"key": "businessTxKey",
										"value": {
											"stringValue": "e8c9f684-e0d4-4ef8-82e9-0663a7bb419c"
										}
									}
								],
								"flags": 1,
								"traceId": "0c4b83464bef9ec856802f7da3dd1c6e",
								"spanId": "345ea23b439e0b77"
							}
						]
					}
				]
			}
		]
	}
}

now, we would like to extract the attribute businessTxKeyDepartmentId and create files (as many as different businessTxKeyDepartmentId values) with its name's ID 5fc60188-f0fd-4b7f-837f-e1fca2e84442

note: this log record is generated by FluentBIt running as side container with OTel Contrib in AKS and stored as blob in Azure Storage.
Any thoughts?

thanks

@smoms smoms added the question Further information is requested label Jun 20, 2024
@cijothomas
Copy link
Member

Sorry, I don't see how this is a question about OpenTelemetry .NET?

@smoms
Copy link
Author

smoms commented Jun 20, 2024

ok sorry.

@cijothomas
Copy link
Member

Closing, as this does not look related to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants