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

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?