Code Monkey home page Code Monkey logo

Comments (4)

RVaidhy avatar RVaidhy commented on May 27, 2024

For your clarification, We are using openobserve-v0.5.1-linux-amd64-musl.tar. Please help !

from openobserve.

oasisk avatar oasisk commented on May 27, 2024

@RVaidhy please upgrade to v0.5.2 , to use functions with more lines.

Also please note , when you ingest data to openobserve all fields names are in small case , for eg :

{"_timestamp":1694143686586724,"agent":"Java","http_status":"220","id":"32qqjhasd34q34n","operation":"USER CALL","request_method":"GET","request_url":"/api/cargo-local/GYQV_MATANO_SAMPLE_REPO/sample.json","request_user_agent":"jfrog-mission-control/erere","timestamp":"2023-08-23T10:49:59.409TZ","username":"anonymous"}

Hence your function needs to be modified to use:
.req_url_split,error1=split(.request_url, "/")

instead of : .req_url_split,error1=split(.request_URL, "/") to

from openobserve.

oasisk avatar oasisk commented on May 27, 2024

tested with above mentioned data & function, working fine with fixes

from openobserve.

RVaidhy avatar RVaidhy commented on May 27, 2024

Hi Oasisk,

Even after applying the fixes that you have mentioned we had that same issue.

To get rid of that we have used the following method. Basically match_array expects regex formatted data. So from a full string if you extract a sub-string and wanted to validate that specific value against array or something we may need to follow the below options.

Say you have a predefined list of values and you wnated to compare the extracted value with that. This is our scenario.
request_url_array = ["sample","values","tobe","inserted","here"]

Now, from logs we have got one field like below.
.extrated_substring = string!(.url)

Convert that to regex as below,
.urlInfoRegex = to_regex(.extrated_substring)?? r''

Now pass this to match_array.
.isUrlExist = match_array(.request_url_array,.urlInfoRegex)

So in our case, if we want to validate a specific value against an array of values we shall refer the above method. It may be useful to someone. Thats why sharing here for ref. Thanks!

from openobserve.

Related Issues (20)

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.