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

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현