-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support content for body #103
Labels
agent-nodejs
Make available for APM Agents project planning.
Comments
github-actions
bot
added
the
agent-nodejs
Make available for APM Agents project planning.
label
Oct 5, 2021
Same problem. Body content is returned as {} instead of correct value. Steps to reproduce
const winston = require('winston')
const ecsFormat = require('@elastic/ecs-winston-format')
const logger = winston.createLogger({
level: 'info',
format: ecsFormat(),
transports: [
new winston.transports.Console()
]
})
logger.info('test1', {
http: {
response: {
body: {
content: '{test:1}'
}
}
}
})
ResultActual{
"@timestamp": "2021-11-18T08:55:49.541Z",
"log.level": "info",
"message": "test1",
"ecs": {
"version": "1.6.0"
},
"http": {
"response": {
"body": {}
}
}
} Expect{
"@timestamp": "2021-11-18T08:55:49.541Z",
"log.level": "info",
"message": "test1",
"ecs": {
"version": "1.6.0"
},
"http": {
"response": {
"body": "test1"
}
}
} Workaround...
logger.info('test1', {
'http.response.body.content': "{test:1}"
}) Output: {
"@timestamp": "2021-11-18T08:55:49.541Z",
"log.level": "info",
"message": "test1",
"ecs": {
"version": "1.6.0"
},
"http.response.body.content": "{test:1}"
} |
My issue is related to format of |
The problem is in const stringify = build({
type: 'object',
properties: {
'@timestamp': string,
'log.level': string,
log: {
type: 'object',
properties: {
logger: string
}
},
message: string,
ecs: {
type: 'object',
properties: {
version: string
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-event.html
event: {
type: 'object',
properties: {
dataset: string,
id: string
},
additionalProperties: true
},
// https://www.elastic.co/guide/en/ecs/current/ecs-http.html
http: {
type: 'object',
properties: {
version: string,
request: {
type: 'object',
properties: {
method: string,
headers: {
type: 'object',
additionalProperties: true
},
body: {
type: 'object',
properties: {
bytes: number
}
}
}
},
response: {
type: 'object',
properties: {
status_code: number,
headers: {
type: 'object',
additionalProperties: true
},
body: {
type: 'object',
properties: {
bytes: number
}
}
}
}
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-url.html
url: {
type: 'object',
properties: {
path: string,
domain: string,
port: number,
query: string,
fragment: string,
full: string
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-client.html
client: {
type: 'object',
properties: {
address: string,
ip: string,
port: number
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-user_agent.html
user_agent: {
type: 'object',
properties: {
original: string
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-tracing.html
trace: {
type: 'object',
properties: {
id: string
}
},
transaction: {
type: 'object',
properties: {
id: string
}
},
span: {
type: 'object',
properties: {
id: string
}
},
// https://www.elastic.co/guide/en/ecs/current/ecs-service.html
service: {
type: 'object',
properties: {
name: string
},
additionalProperties: true
},
// https://www.elastic.co/guide/en/ecs/current/ecs-error.html
error: {
type: 'object',
properties: {
type: string,
message: string,
stack_trace: string
},
additionalProperties: true
}
},
additionalProperties: true
}) Only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is possible to add support for body content for request and response based on new spec?
Request body content
Response body content
When i try to add it manually the content is not sent, I assume it has something to do with the stringify serializer?
The text was updated successfully, but these errors were encountered: