InfluxDB how to escape square brackets “[”Calculating rates in InfluxDBhow to remove a particular row of data from influxdbInfluxDB goes down for huge dataDisable WAL in influxdb v0.13 or force flushInfluxDB count same string values for a timerangeInfluxDB Line Protocol Bad TimestampInfluxDB Query issue when measurement name have hyphen in itInfluxDB: How to create a continuous query to calculate delta values?how to join two measurement of influxdb

How do we handle pauses in a dialogue?

Do I have to worry about delays in international trains? (UK, Belgium, Germany)

Through: how to use it with subtraction of functions?

What is this little owl-like bird?

How to tell someone I'd like to become friends without letting them think I'm romantically interested in them?

Stacked light circle effect in Photoshop?

What is the correct parsing of お高くとまる?

Is there a nice way to implement a conditional type with default fail case?

When an electron changes its spin, or any other intrinsic property, is it still the same electron?

Redundancy in rappel systems

What is the right approach to quit a job during probation period for a competing offer?

How can a dictatorship government be beneficial to a dictator in a post-scarcity society?

What's it called when the bad guy gets eaten?

What is the minimum time required for final wash in film development?

LED glows slightly during soldering

Chorophyll and photosynthesis in plants with coloured leaves

Is it possible to see individual photons impressioning film?

How quality assurance engineers test calculations?

Could you brine steak?

What does 오지다 mean?

Data Encryption by Application vs Data Encryption in Database

Is it possible to set permissions on schema fields to restrict editing of them to certain users?

Is a request to book a business flight ticket for a graduate student an unreasonable one?

What do three diagonal dots above a letter mean in the "Misal rico de Cisneros" (Spain, 1518)?



InfluxDB how to escape square brackets “[”


Calculating rates in InfluxDBhow to remove a particular row of data from influxdbInfluxDB goes down for huge dataDisable WAL in influxdb v0.13 or force flushInfluxDB count same string values for a timerangeInfluxDB Line Protocol Bad TimestampInfluxDB Query issue when measurement name have hyphen in itInfluxDB: How to create a continuous query to calculate delta values?how to join two measurement of influxdb






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I am querying influx D.B. as shown below,



select * from measurement where '/cda/stats/@name' =~ /cda/stats.*/ limit 5;


Above query is working fine, but when i try to specify square brackets in the query string it is not working, for e.g. "/cda/stats/[name='set']



select * from mgmgrand where '/cda/stats/@name' =~ /cda/stats[name='set'].*/ limit 5;


Not sure how to escape square brackets in the above query.



Back slash "" is not working with square brackets.










share|improve this question



















  • 1





    Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

    – Sculper
    Apr 10 at 20:10











  • It's not working. Do i need to escape the single quotes ' as well?

    – Ammad
    Apr 11 at 22:46











  • No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

    – Sculper
    Apr 11 at 23:43











  • I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

    – Ammad
    Apr 12 at 0:51


















3















I am querying influx D.B. as shown below,



select * from measurement where '/cda/stats/@name' =~ /cda/stats.*/ limit 5;


Above query is working fine, but when i try to specify square brackets in the query string it is not working, for e.g. "/cda/stats/[name='set']



select * from mgmgrand where '/cda/stats/@name' =~ /cda/stats[name='set'].*/ limit 5;


Not sure how to escape square brackets in the above query.



Back slash "" is not working with square brackets.










share|improve this question



















  • 1





    Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

    – Sculper
    Apr 10 at 20:10











  • It's not working. Do i need to escape the single quotes ' as well?

    – Ammad
    Apr 11 at 22:46











  • No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

    – Sculper
    Apr 11 at 23:43











  • I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

    – Ammad
    Apr 12 at 0:51














3












3








3


1






I am querying influx D.B. as shown below,



select * from measurement where '/cda/stats/@name' =~ /cda/stats.*/ limit 5;


Above query is working fine, but when i try to specify square brackets in the query string it is not working, for e.g. "/cda/stats/[name='set']



select * from mgmgrand where '/cda/stats/@name' =~ /cda/stats[name='set'].*/ limit 5;


Not sure how to escape square brackets in the above query.



Back slash "" is not working with square brackets.










share|improve this question
















I am querying influx D.B. as shown below,



select * from measurement where '/cda/stats/@name' =~ /cda/stats.*/ limit 5;


Above query is working fine, but when i try to specify square brackets in the query string it is not working, for e.g. "/cda/stats/[name='set']



select * from mgmgrand where '/cda/stats/@name' =~ /cda/stats[name='set'].*/ limit 5;


Not sure how to escape square brackets in the above query.



Back slash "" is not working with square brackets.







influxdb influxql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 at 6:22









loic.lopez

5201 gold badge6 silver badges25 bronze badges




5201 gold badge6 silver badges25 bronze badges










asked Mar 26 at 0:16









AmmadAmmad

1,4002 gold badges22 silver badges39 bronze badges




1,4002 gold badges22 silver badges39 bronze badges







  • 1





    Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

    – Sculper
    Apr 10 at 20:10











  • It's not working. Do i need to escape the single quotes ' as well?

    – Ammad
    Apr 11 at 22:46











  • No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

    – Sculper
    Apr 11 at 23:43











  • I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

    – Ammad
    Apr 12 at 0:51













  • 1





    Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

    – Sculper
    Apr 10 at 20:10











  • It's not working. Do i need to escape the single quotes ' as well?

    – Ammad
    Apr 11 at 22:46











  • No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

    – Sculper
    Apr 11 at 23:43











  • I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

    – Ammad
    Apr 12 at 0:51








1




1





Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

– Sculper
Apr 10 at 20:10





Backslashes should work. Depending on what "not working" means, I think the root of the problem might be a missing / between "stats" and "[name='set]'". So you'd end up with something like /cda/stats/[name='set']

– Sculper
Apr 10 at 20:10













It's not working. Do i need to escape the single quotes ' as well?

– Ammad
Apr 11 at 22:46





It's not working. Do i need to escape the single quotes ' as well?

– Ammad
Apr 11 at 22:46













No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

– Sculper
Apr 11 at 23:43





No - the regex seems to work after fixing that slash, at least if I'm correctly understanding what you're testing against. You can test your expression against one of your values here.

– Sculper
Apr 11 at 23:43













I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

– Ammad
Apr 12 at 0:51






I am trying to read this data:select * from mgmgrand where '/cda-stats/server-api-agg/server-api-server/server-api-stats/@name' =~ /cda-stats/server-api-agg/server-api-server/server-api-stats/[name='ExprCntrFarmRead'].*/ limit 5; But it is not picking up and in DB value is /cda-stats/server-api-agg/server-api-server/server-api-stats[name='ExprCntrFarmRead']

– Ammad
Apr 12 at 0:51













1 Answer
1






active

oldest

votes


















1














I tested this in influx DB and found a weird solution (I don't know why it works).
If your identifer is unquoted changing single quotes to double quotes, replacing '/cda/stats/@name' with "/cda/stats/@name" seems to fix it.



select * from mgmgrand where "/cda/stats/@name" =~ /[/
//matches the value /cda/stats/[name='set']


Without changing the quotes it works fine for value without [ , but doesnt work when trying to match a [ character.



select * from mgmgrand where '/cda/stats/@name' =~ /cda/
//matches the value /cda/stats/[name='set']


select * from val1 where '/cda/stats/@name' =~ /[/
//does not give an output


If you use a quoted identifier replacing '/cda/stats/@name' with "'/cda/stats/@name'" or ""/cda/stats/@name"" fixes it.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348155%2finfluxdb-how-to-escape-square-brackets%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I tested this in influx DB and found a weird solution (I don't know why it works).
    If your identifer is unquoted changing single quotes to double quotes, replacing '/cda/stats/@name' with "/cda/stats/@name" seems to fix it.



    select * from mgmgrand where "/cda/stats/@name" =~ /[/
    //matches the value /cda/stats/[name='set']


    Without changing the quotes it works fine for value without [ , but doesnt work when trying to match a [ character.



    select * from mgmgrand where '/cda/stats/@name' =~ /cda/
    //matches the value /cda/stats/[name='set']


    select * from val1 where '/cda/stats/@name' =~ /[/
    //does not give an output


    If you use a quoted identifier replacing '/cda/stats/@name' with "'/cda/stats/@name'" or ""/cda/stats/@name"" fixes it.






    share|improve this answer





























      1














      I tested this in influx DB and found a weird solution (I don't know why it works).
      If your identifer is unquoted changing single quotes to double quotes, replacing '/cda/stats/@name' with "/cda/stats/@name" seems to fix it.



      select * from mgmgrand where "/cda/stats/@name" =~ /[/
      //matches the value /cda/stats/[name='set']


      Without changing the quotes it works fine for value without [ , but doesnt work when trying to match a [ character.



      select * from mgmgrand where '/cda/stats/@name' =~ /cda/
      //matches the value /cda/stats/[name='set']


      select * from val1 where '/cda/stats/@name' =~ /[/
      //does not give an output


      If you use a quoted identifier replacing '/cda/stats/@name' with "'/cda/stats/@name'" or ""/cda/stats/@name"" fixes it.






      share|improve this answer



























        1












        1








        1







        I tested this in influx DB and found a weird solution (I don't know why it works).
        If your identifer is unquoted changing single quotes to double quotes, replacing '/cda/stats/@name' with "/cda/stats/@name" seems to fix it.



        select * from mgmgrand where "/cda/stats/@name" =~ /[/
        //matches the value /cda/stats/[name='set']


        Without changing the quotes it works fine for value without [ , but doesnt work when trying to match a [ character.



        select * from mgmgrand where '/cda/stats/@name' =~ /cda/
        //matches the value /cda/stats/[name='set']


        select * from val1 where '/cda/stats/@name' =~ /[/
        //does not give an output


        If you use a quoted identifier replacing '/cda/stats/@name' with "'/cda/stats/@name'" or ""/cda/stats/@name"" fixes it.






        share|improve this answer















        I tested this in influx DB and found a weird solution (I don't know why it works).
        If your identifer is unquoted changing single quotes to double quotes, replacing '/cda/stats/@name' with "/cda/stats/@name" seems to fix it.



        select * from mgmgrand where "/cda/stats/@name" =~ /[/
        //matches the value /cda/stats/[name='set']


        Without changing the quotes it works fine for value without [ , but doesnt work when trying to match a [ character.



        select * from mgmgrand where '/cda/stats/@name' =~ /cda/
        //matches the value /cda/stats/[name='set']


        select * from val1 where '/cda/stats/@name' =~ /[/
        //does not give an output


        If you use a quoted identifier replacing '/cda/stats/@name' with "'/cda/stats/@name'" or ""/cda/stats/@name"" fixes it.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 12 at 19:42

























        answered Apr 12 at 19:18









        Sandeep PolamuriSandeep Polamuri

        4407 bronze badges




        4407 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348155%2finfluxdb-how-to-escape-square-brackets%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript