Logmanager documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Text substring tests

This block compares string in the given variable. Left part defines the variable to compare and argument is required.

Middle part three types of comparison modes available:

  • begin with: Content of the variable begin with text.
  • ends with: Content of the variable ends with text.
  • contains: Content of the variable contains text.

Right side defines string for comparison and argument is required.

Result of the block is boolean value “true” or “false”.

In case any of required string arguments is not string returns None.

Block XML representation

XML representation of text_test_substring block

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="text_test_substring">
    <field name="TYPE">BEGINSWITH</field>
    <value name="VALUE">
      <block type="variables_get">
        <field name="VAR">text</field>
      </block>
    </value>
    <value name="FIND">
      <block type="text">
        <field name="TEXT">value</field>
      </block>
    </value>
  </block>
  <block type="text_test_substring">
    <field name="TYPE">ENDSWITH</field>
    <value name="VALUE">
      <block type="variables_get">
        <field name="VAR">text</field>
      </block>
    </value>
    <value name="FIND">
      <block type="text">
        <field name="TEXT">value</field>
      </block>
    </value>
  </block>
  <block type="text_test_substring">
    <field name="TYPE">CONTAINS</field>
    <value name="VALUE">
      <block type="variables_get">
        <field name="VAR">text</field>
      </block>
    </value>
    <value name="FIND">
      <block type="text">
        <field name="TEXT">value</field>
      </block>
    </value>
  </block>
</xml>

Example of visual representation

Block "Text substring test"

Block “Text substring test”

Example of block usage

Example of "Text substring test" block

Example of “Text substring test” block

Block is used on the “if text message” row in the example:

  • If key “raw” in variable “message” starts with text “Login”, then the block returns boolean value “true”.

Input data

Login permitted from 192.168.10.1/1234 to inside:192.168.1.1/https for user admin

Processing result

Results of "Text substring test" block

Results of “Text substring test” block