diff --git a/docs/search/search-query-language/search-operators/macro.md b/docs/search/search-query-language/search-operators/macro.md index 02393ddbf3..fadde6f5d4 100644 --- a/docs/search/search-query-language/search-operators/macro.md +++ b/docs/search/search-query-language/search-operators/macro.md @@ -39,12 +39,13 @@ To create a macro, follow the steps below: 1. [**New UI**](/docs/get-started/sumo-logic-ui/). In the main Sumo Logic menu, select **Data Management**, and then under **Logs**, select **Macros**. You can also click the **Go To...** menu at the top of the screen and select **Macros**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data** > **Logs** > **Macros**. 1. Click **+ Add Macro**.
macro-logs-page 1. Or, in the log search page, select the part of search query language that needs to be reused and click on **Create Macro**.
macro-search-page -1. **Macro Details**. Enter the name for the macro. Description is optional. -1. **Macro Definition**. Enter the definition for the macro. To add arguments use the `{{Arg}}` syntax or select a part of the definition and click on **Add Argument**. -1. (Optional) **Arguments**. Enter the name and select the data type for the argument selected. -1. (Optional) **Argument Validation**. Define the validation condition and enter the error message that needs to be shown when the validation expression returns false. -1. **Usage**. Preview of how you use the macro in the log search. -1. Click **Submit** to save the macro. +1. In the **Create Macro** page, enter the following details:
create-macro + 1. **Macro Details**. Enter the name for the macro. Description is optional. + 1. **Macro Definition**. Enter the definition for the macro. To add arguments use the `{{Arg}}` syntax or select a part of the definition and click on **Add Argument**. + 1. (Optional) **Arguments**. Enter the name and select the data type for the argument selected. + 1. (Optional) **Argument Validation**. Define the validation condition and enter the error message that needs to be shown when the validation expression returns false. + 1. **Usage**. Preview of how you use the macro in the log search. + 1. Click **Submit** to save the macro. ### Limitations @@ -110,3 +111,18 @@ To view any existing macro, follow the steps below: 1. [**New UI**](/docs/get-started/sumo-logic-ui/). In the main Sumo Logic menu, select **Data Managemenu**, and then under **Logs**, select **Macros**. You can also click the **Go To...** menu at the top of the screen and select **Macros**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data** > **Logs** > **Macros**. 1. In the **Macros** page, click on any of the macros that you want to view the macro details.
macro-logs-page 1. To use the selected macro in your log search query, copy the suggested **Usage** of the macro and include it in your query syntax.
view-macro-logs-details + +## Edit a macro operator + +1. [**New UI**](/docs/get-started/sumo-logic-ui/). In the main Sumo Logic menu, select **Data Management**, and then under **Logs**, select **Macros**. You can also click the **Go To...** menu at the top of the screen and select **Macros**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data** > **Logs** > **Macros**. +1. In the **Macros** page, click on any of the macros that you want to edit.
macro-logs-page +1. Click **Edit** button to open the pane for editing.
macro-delete-pop-up +1. In the **Edit [macroname] macro** pop-up, click on **Continue**. You can also check where your macros have been used to avoid broken queries by clicking on **check queries that reference this macro**.
macro-delete-pop-up +1. In the macro editing pane, perform the required editing and click **Submit**. + +## Delete a macro operator + +1. [**New UI**](/docs/get-started/sumo-logic-ui/). In the main Sumo Logic menu, select **Data Management**, and then under **Logs**, select **Macros**. You can also click the **Go To...** menu at the top of the screen and select **Macros**.
[**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data** > **Logs** > **Macros**. +1. In the **Macros** page, click on any of the macros that you want to delete.
macro-logs-page +1. Click **Delete** button to delete the macro.
macro-delete-button +1. In the **Delete [macroname] macro** pop-up, click on **Delete**. You can also check where your macros have been used to avoid broken queries by clicking on **check queries that reference this macro**.
macro-delete-pop-up \ No newline at end of file diff --git a/static/img/search/searchquerylanguage/search-operators/create-macro.png b/static/img/search/searchquerylanguage/search-operators/create-macro.png new file mode 100644 index 0000000000..840d13e1a0 Binary files /dev/null and b/static/img/search/searchquerylanguage/search-operators/create-macro.png differ diff --git a/static/img/search/searchquerylanguage/search-operators/macro-delete-button.png b/static/img/search/searchquerylanguage/search-operators/macro-delete-button.png new file mode 100644 index 0000000000..8558db3571 Binary files /dev/null and b/static/img/search/searchquerylanguage/search-operators/macro-delete-button.png differ diff --git a/static/img/search/searchquerylanguage/search-operators/macro-delete-pop-up.png b/static/img/search/searchquerylanguage/search-operators/macro-delete-pop-up.png new file mode 100644 index 0000000000..fb4dd26920 Binary files /dev/null and b/static/img/search/searchquerylanguage/search-operators/macro-delete-pop-up.png differ diff --git a/static/img/search/searchquerylanguage/search-operators/macro-edit-button.png b/static/img/search/searchquerylanguage/search-operators/macro-edit-button.png new file mode 100644 index 0000000000..bf6feab697 Binary files /dev/null and b/static/img/search/searchquerylanguage/search-operators/macro-edit-button.png differ diff --git a/static/img/search/searchquerylanguage/search-operators/macro-edit-pop-up.png b/static/img/search/searchquerylanguage/search-operators/macro-edit-pop-up.png new file mode 100644 index 0000000000..eca493cad7 Binary files /dev/null and b/static/img/search/searchquerylanguage/search-operators/macro-edit-pop-up.png differ