Add manual input to a query on a button?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Add manual input to a query on a button?

L1 Bithead

Greetings all.
I have this situation I am trying to resolve, but can't find a solution.

I have a dynamic section in a layout, in which I want to add a button. When clicked, this button should run a query, but it should first ask for a user input, which needs to be a part of the query.

Example:
I want a button to run a Azure Log Analytics query.
I make the button, the azure-log-analytics-execute-query button script.
Say the query should be:
CommonSecurityLog
| where SourceIP == "USERINPUT"

 

So, the execution would need to be:
1: User clicks button
2: Button asks the user for the IP to use.
3: User provides the input (IP), and the input replaces the "USERINPUT" field in the query.

Does anyone have any smart solutions to this?
Only reasonable alternative I have come up with, is to have another button which uses the setIncident script, sets the user input as a context field, and then the query uses that context field as the input.
A python script could do this too, but the end result would be the same (?), as the script would also use a context field for input.

1 accepted solution

Accepted Solutions

L4 Transporter

In this case you can just wrap the command in an automation script, and have that script present the arguments/input to the user.  Anything marked mandatory will be prompted for, anything option you have the option to ask the User when you add the button to the layout.  

 

Would look something like this:

Screen Shot 2023-03-20 at 8.25.18 AM.pngScreen Shot 2023-03-20 at 8.25.14 AM.pngScreen Shot 2023-03-20 at 8.25.57 AM.png

 

Basically what is covered in video 11 of the training series: https://live.paloaltonetworks.com/t5/cortex-xsoar-how-to-videos/cortex-xsoar-how-to-customer-success...

View solution in original post

1 REPLY 1

L4 Transporter

In this case you can just wrap the command in an automation script, and have that script present the arguments/input to the user.  Anything marked mandatory will be prompted for, anything option you have the option to ask the User when you add the button to the layout.  

 

Would look something like this:

Screen Shot 2023-03-20 at 8.25.18 AM.pngScreen Shot 2023-03-20 at 8.25.14 AM.pngScreen Shot 2023-03-20 at 8.25.57 AM.png

 

Basically what is covered in video 11 of the training series: https://live.paloaltonetworks.com/t5/cortex-xsoar-how-to-videos/cortex-xsoar-how-to-customer-success...

  • 1 accepted solution
  • 1950 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!