Giter Site home page Giter Site logo

jq-json-logfilter's People

Contributors

ahormazabal avatar gschueler avatar ltamaster avatar sjrd218 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jq-json-logfilter's Issues

Pass Global variables to jq filter

I'm wondering if it's possible to run the following in jq-filter in order to capture a value in a json output:

.[] | select( .address | contains (${Variables_Uplink_Update.ipAddress}))

The ${Variables_Uplink_Update.ipAddress} is a Global variable on the jobs.

Best regards!

Raw output

Is it possible to use -r to get the raw output of the value? In rundeck, I am only able to create the filter itself, not jq -r 'filter'.

How exactly does the 'Prefix' work?

I've been testing out the 'jq-json-logfilter' with REST API reading, and I do have this log filter mostly working, but I can't for the life of me figure out how the 'Prefix' is used.

I've set different values for the Prefix, but it seems to be completely ignored by RunDeck --- all data defaults back to ${data.} that is getting parsed.

For example, if I create a 'Prefix' to the value of 'tenant', does this gets prefixed at the attribute level, such as:

${data.tenant.}

or does this affect the actual exported object:

${tenant.}

Any help or some additional details around how Prefix is used by the Log Filter would be very much appreciated, but as of right now -- RunDeck seems to ignore anything I write into the prefix attribute.

Thanks a bunch! Definitely useful and needed functionality!

Only works if output is "pretty"

Hi guys

Curl responses are usually returned without any linebreaks or spacing. This isn't a problem when using jq via the command line.

However this filter doesn't pick up on values unless the response is "prettified" first. I'm working around this by capturing the response in a variable and running it through jq eg: echo $RESPONSE | jq . This outputs a prettified response which the filter can work with.

This may also be related to #7. Perhaps the parsing methods used in the filter could be improved so they're more robust?

JSON jq key/Value - Keys Cannot Have Spaces

Hi all

have come up against a bit of a brick wall with this. using the JSON jq key/Value mapper to grab variables in a job and it's working great. the only snaffoo is that for some of our values have spaces in them... which means when we try to call them ${data.some thing} we can't

Anyone have any ideas?

Thanks
Rich

parsing field from list

Running jq directly the following example gives such result:
java -jar jackson-jq-cli-1.0.0-preview.20210928.jar ".values[].displayId"
{"size":4,"limit":25,"isLastPage":true,"values":[{"id":"refs/heads/release/21.3.1","displayId":"release/21.3.1","type":"BRANCH","latestCommit":"cd1be2db485a7518c60f24d792814e89ba924e6d","latestChangeset":"cd1be2db485a7518c60f24d792814e89ba924e6d","isDefault":false},{"id":"refs/heads/release/21.4.1","displayId":"release/21.4.1","type":"BRANCH","latestCommit":"3f2118816aaa48decdccc7e03bdf8a0bb9726545","latestChangeset":"3f2118816aaa48decdccc7e03bdf8a0bb9726545","isDefault":false},{"id":"refs/heads/release/22.1.1","displayId":"release/22.1.1","type":"BRANCH","latestCommit":"3fb98b205cd2fdfe1466c5f535b309ea882d57c0","latestChangeset":"3fb98b205cd2fdfe1466c5f535b309ea882d57c0","isDefault":false},{"id":"refs/heads/release/22.2.1","displayId":"release/22.2.1","type":"BRANCH","latestCommit":"8e49efb0613e433947d228e756c90333086ec518","latestChangeset":"8e49efb0613e433947d228e756c90333086ec518","isDefault":false}],"start":0}

"release/21.3.1"
"release/21.4.1"
"release/22.1.1"
"release/22.2.1"

when running the same with jq-json-logfilter
image

I get only the last value instead of four

image

Can't capture json if anything else is in output

Hi, I'm testing this plugin and I'm facing a weird behavior, this is my setup:

  • Rundeck 3.3.2
  • jq-json-logfilter 1.0.4

I'm using ansible to get informations from an API, which send me back json datas.
I'm want to capture them, but always facing this same response:

PLAY [XXXX] ***************************************************************
TASK [XXXX] ****************************************************************ok: [localhost]
TASK [XXXX] **********************************************ok: [localhost]
TASK [XXXX] *************************************************ok: [localhost]
TASK [XXXX] *************************************************************ok: [localhost] => 
{ "aaaaaaa": { "bbbbbb": { "ccccc": [ { "ddddd": { "self": { "href": "https://eeeeeeeeeeeee" } },
"attributes": { "fffffff": "ggggggggg" }, "description": "hhhhhhhhh", "id": 111111, "iiiiii": "112233445566",
"jjjjj": "kkkkkkkkkkk" } ] }, "llllllll": { "zzzzz": { "href": "https://mmmmmmmmmmmmmmmm" } } }}

PLAY RECAP *********************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

[error] cannot map the json output: Unrecognized token 'PLAY':
was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)"

I tried with multiple filters which leads to the same things. When trying with debug output it's another word picked up but it still fail.

Did I miss something or is the plugin waiting for a json only output ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.