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

Unsupported json input with minus character in key value #102

Open
fraf opened this issue Feb 7, 2025 · 0 comments
Open

Unsupported json input with minus character in key value #102

fraf opened this issue Feb 7, 2025 · 0 comments

Comments

@fraf
Copy link

fraf commented Feb 7, 2025

Hello,

I need to SED a json input file so as to remove all "'-" (minus) character when they are present as a key. e.g. :
{
"my-key": "my-value"
}

need to be "sed" processed so as to obtain the resulting json :
{
"my_key":"my-value"
}

Can you correctly parse json input taking into account those "minus" in key value ?

Regards.

This command should run ok :

cat gravitee-request-2024.06.08-single.json | spyql -Otable=gravitee_request_2024_06_08 "SELECT json->_index, json->_type, json->_id, json->_score, json->_source.subscription, json->_source.request_content_length, json->_source.local_address, json->_source.path, json->_source.response_content_length, json->_source.remote_address, json->_source.host, json->_source.api, json->_source.plan, json->_source.tenant, json->_source.method, json->_source.custom, json->_source.response_time, json->_source.uri, json->_source.timestamp, json->_source.proxy_latency, json->_source.application, json->_source.api_response_time, json->_source.gateway, json->_source.transaction, json->_source.status, json->_source.user_agent FROM json TO sql" 2>/dev/null > output.sql

letting original json->_source.api-response-time (I.e. without transforming to : json->_source.api_response_time )

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