Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Adapter "log Parser" - Komma bereinigen

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Adapter "log Parser" - Komma bereinigen

    This topic has been deleted. Only users with topic management privileges can see it.
    • bahnuhr
      bahnuhr Forum Testing Most Active last edited by bahnuhr

      Folgenden Eintrag hab ich nun bei Bereinigen genommen:

      json = ,/{"name"[^] "status": /,/ "clock"[^*]*true}/

      Aus:
      {"name": "Robo-Maeh", "id": "081603", "status": {"status": 17, "distance": 0, "stopped": false, "dooropen": false, "duration": 182300, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97, "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25}, "clock": {"date": "2020-10-06", "time": "21:51:59", "unix": 1602021119}, "successful": true}

      wird dann:
      {"status": 17, "distance": 0, "stopped": false, "dooropen": false, "duration": 184100, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97, "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25},

      Nur das letzte Komma bekomme ich nicht weg.
      In regex101 passt es.
      Aber in iob will dies nicht so richtig.
      Sobald das Komma vor clock steht, will iob nicht.

      @Homoran
      Du bist für mich der regex Spezialist.
      Hast du eine Idee warum dies net tut.

      mfg
      Dieter

      Homoran 1 Reply Last reply Reply Quote 0
      • bahnuhr
        bahnuhr Forum Testing Most Active last edited by

        wie gesagt in regex101 tut es:
        bf61235b-f913-4620-b28e-24af8518602a-image.png

        1 Reply Last reply Reply Quote 0
        • Homoran
          Homoran Global Moderator Administrators @bahnuhr last edited by

          @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

          Du bist für mich der regex Spezialist.

          was macht denn hier das regex?

          wenn ich den Thread verstanden habe willst du etwas mit Komma nicht separiert haben.
          Hast du da schon mal versucht das Komma zu escapen \, oder in Hochkommata zu setzen 'bla,blubb'

          Ich verstehe nicht wo hier was für ein Regex machen soll. Im Screenshot ist ein anderes als im Text

          bahnuhr 1 Reply Last reply Reply Quote 0
          • bahnuhr
            bahnuhr Forum Testing Most Active @Homoran last edited by

            @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

            was macht denn hier das regex?

            Jetzt hatte ich alles schon geschrieben (inkl. Hardcopy)
            Und dann war das Forum nicht erreichbar. Ärgerlich.

            Fazit:
            \ und ' klappt nicht.
            Der Adapter mag keine Komma im String.
            Funktioniert nicht.

            mfg
            Dieter

            Homoran 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators @bahnuhr last edited by

              @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

              Jetzt hatte ich alles schon geschrieben (inkl. Hardcopy)

              und ich verstehe immer noch nicht was du erreichen willst.

              Ich kenne den Adapter nicht und weiß nicht wie er funktioniert.
              Was soll das RegEx denn bewirken?
              Was soll herauskommen?

              Kannst du da mal ein Beispiel geben?
              Vorher (Original) -> Nachher (Wunschzustand)

              bahnuhr 1 Reply Last reply Reply Quote 0
              • bahnuhr
                bahnuhr Forum Testing Most Active @Homoran last edited by bahnuhr

                @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                Vorher (Original) -> Nachher (Wunschzustand)

                Original:
                json = {"name": "Robo-Maeh", "id": "081603", "status": {"status": 17, "distance": 0, "stopped": false, "dooropen": false,
                "duration": 182300, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97,
                "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25}, "clock":
                {"date": "2020-10-06", "time": "21:51:59", "unix": 1602021119}, "successful": true}

                Wunsch:
                {"status": 17, "distance": 0, "stopped": false, "dooropen": false,
                "duration": 182300, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97,
                "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25}

                also:
                vorne bis status weg
                und hinten ab clcok weg

                erreicht habe ich dies bei Bereinigen mit:
                json = ,/{"name"[^] "status": /,/ "clock"[^*]*true}/

                es kommt dann:
                {"status": 17, "distance": 0, "stopped": false, "dooropen": false, "duration": 184100, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97, "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25},

                -> Aber das letzte Komma geht nicht weg. Egal welcher regex ich benutze; (was aber in regex101 klappt)

                Problem:
                Adapter trennt die einzelnen Ausdrücke per Komma.

                Homoran 1 Reply Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

                  @bahnuhr

                  versuch es mal mit

                  tus": {"([[:ascii:]\s]+). "cl

                  regex101 hat mich gerade extrem verunsischert, üblicherweise steht ein Punkt für jedes beliebige Zeichen, anscheinend nicht in eckigen Klammern, also bei [.\s]+ gilt der Punkt angeblich tatsächlich nur als Punkt 😞

                  und du willst vorne hinter dem ersten "status" tatsächlich die führende geschweifte Klammer weg haben?

                  bahnuhr 1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active @Homoran last edited by

                    @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                    und du willst vorne hinter dem ersten "status" tatsächlich die führende geschweifte Klammer weg haben?

                    Ne, ist aber im Wunsch doch noch drin.
                    Wunsch:
                    {"status": 17,...

                    Habe es mal versucht mit regex101
                    Es wird aber nichts gemacht.
                    bdf2b930-1283-4f20-84d5-3f4bbf26dad3-image.png

                    Homoran 1 Reply Last reply Reply Quote 0
                    • Homoran
                      Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

                      @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

                      Habe es mal versucht mit regex101

                      wo meinst du, dass ich es her habe?
                      Dieter_007.png

                      Sorry, mein Fehler - melde mich gleich!

                      1 Reply Last reply Reply Quote 0
                      • bahnuhr
                        bahnuhr Forum Testing Most Active last edited by

                        dein oben geposteter sieht aber anders aus

                        Homoran 1 Reply Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @bahnuhr last edited by Homoran

                          @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

                          dein oben geposteter sieht aber anders aus

                          ja, hatte ihn anschließend noch was optimiert

                          Aber jetzt: tus": {"(.+\s.+\s.+), "cl

                          oder: tus": {"([\w\W]+), "cl

                          1 Reply Last reply Reply Quote 0
                          • bahnuhr
                            bahnuhr Forum Testing Most Active last edited by

                            @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                            tus": {"(.+\s.+\s.+), "cl

                            Rainer,
                            ich brauchs aber genau andersrum.
                            gemacht werden muss:
                            json = {"name": "Robo-Maeh", "id": "081603", "status":
                            und
                            , "clock": {"date": "2020-10-06", "time": "21:51:59", "unix": 1602021119}, "successful": true}

                            Also der erste und letzte Teil, weil dies wird ja bereinigt.
                            Stehen bleiben soll dann:
                            {"status": 17, "distance": 0, "stopped": false, "dooropen": false, "duration": 182300, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97, "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25}

                            Gerne auch in 2 matches.
                            kann man ja dann mit Komma getrennt eintragen.

                            Homoran 1 Reply Last reply Reply Quote 0
                            • bahnuhr
                              bahnuhr Forum Testing Most Active last edited by bahnuhr

                              @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

                              json = {"name": "Robo-Maeh", "id": "081603", "status": {"status": 17, "distance": 0, "stopped": false, "dooropen": false,
                              "duration": 182300, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97,
                              "hours": 6, "days": 6}, "wlan": {"signal": -74}, "health": {"temperature": 23, "humidity": 25}, "clock":
                              {"date": "2020-10-06", "time": "21:51:59", "unix": 1602021119}, "successful": true}

                              Der 1. Teil geht so:
                              4cf2440b-72be-4de9-ab2b-9c80981296db-image.png

                              Nur der 2. Teil geht nicht.

                              1 Reply Last reply Reply Quote 0
                              • Homoran
                                Homoran Global Moderator Administrators @bahnuhr last edited by

                                @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

                                ich brauchs aber genau andersrum.

                                Dan sach das doch 😉

                                bahnuhr 1 Reply Last reply Reply Quote 0
                                • bahnuhr
                                  bahnuhr Forum Testing Most Active last edited by

                                  Und der 2. Teil klappt in regex101 so:
                                  36610260-6b28-4e9a-a35b-e2016e22769b-image.png

                                  Jedoch nicht im Adapter.

                                  1 Reply Last reply Reply Quote 0
                                  • bahnuhr
                                    bahnuhr Forum Testing Most Active @Homoran last edited by

                                    @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                                    Dan sach das doch

                                    Hab ich 😉

                                    Homoran 1 Reply Last reply Reply Quote 0
                                    • Homoran
                                      Homoran Global Moderator Administrators @bahnuhr last edited by

                                      @bahnuhr 2. Teoil: (, "cl[\w\W]+)

                                      bahnuhr 1 Reply Last reply Reply Quote 0
                                      • bahnuhr
                                        bahnuhr Forum Testing Most Active @Homoran last edited by bahnuhr

                                        @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                                        (, "cl[\w\W]+)

                                        Ich sags ja.
                                        In 101 funktioniert dies.

                                        Im Adapter nicht !

                                        Der Teil wird nicht entfernt!
                                        Weiterhin:
                                        json = {"name": "Robo-Maeh", "id": "081603", "status": {"status": 17, "distance": 0, "stopped": false, "dooropen": false, "duration": 243382, "mode": 2, "battery": 100, "hours": 6}, "timer": {"status": 0}, "blades": {"quality": 97, "hours": 6, "days": 6}, "wlan": {"signal": -75}, "health": {"temperature": 25, "humidity": 24}, "clock": {"date": "2020-10-07", "time": "14:49:59", "unix": 1602082199}, "successful": true}

                                        Eingegeben ist:
                                        9725c85b-9c6a-420d-a351-ce9bb2915b46-image.png

                                        Homoran 1 Reply Last reply Reply Quote 0
                                        • Homoran
                                          Homoran Global Moderator Administrators @bahnuhr last edited by

                                          @bahnuhr sagte in Adapter "log Parser" - Komma bereinigen:

                                          Im Adapter nicht !

                                          auch nicht in dieser Schreibweise 😞

                                          was steht denn im Editor?

                                          bahnuhr 1 Reply Last reply Reply Quote 0
                                          • bahnuhr
                                            bahnuhr Forum Testing Most Active @Homoran last edited by

                                            @Homoran sagte in Adapter "log Parser" - Komma bereinigen:

                                            was steht denn im Editor?

                                            Lt. Anleitung sind regex im Adapter mit / ... / einzuschließen.

                                            Was meinst du mit Editor ?

                                            Homoran 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            497
                                            Online

                                            31.6k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            komma log parser
                                            3
                                            37
                                            823
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo