Splunk® AI Assistant for SPL

Install and use Splunk AI Assistant for SPL

Using Splunk AI Assistant for SPL

Splunk AI Assistant for SPL offers bi-directional translation between natural language (NL) and Splunk Search Processing Language (SPL). The assistant can help all users gain familiarity and confidence with SPL.

Using a shared account to log in, and having multiple people access the app with that one account login, causes issues with app results and app behavior. Have each user log in with their own username and password, and not a shared username and password.

You can use Splunk AI Assistant for SPL to help create searches, understand searches, and learn SPL. You can also use the assistant to make more efficient SPL searches and learn more about what your current SPL searches are doing with detailed breakdowns. All levels of users can use Splunk AI Assistant for SPL to learn more about Splunk platform products and features.

You can use version 1.0.0 or higher of the app for as long as you have an active Splunk Cloud Platform subscription.

The following image shows Splunk AI Assistant for SPL when you select +New Chat. From this page choose Write SPL, Explain SPL, or Tell me about...:

This image shows the main page for Splunk AI Assistant for SPL. From this view you can start a New Chat. This new chat can perform one of three tasks - Write SPL, Explain SPL, or Tell me more about. All chats are saved and can be renamed or deleted from the left side of the page.

Version 1.0.x is free to use for a limited time. When using the free version of the assistant Splunk can throttle usage in our sole discretion.

Splunk AI Assistant for SPL navigation

Splunk AI Assistant for SPL includes the following components:

Component name Description
New Chat Write SPL option: Choose this option to have the app translate plain, natural language into usable SPL.
Explain SPL option: Choose this option to have the app translate SPL into plain language.
Tell me about... option: Choose this option to learn more about a Splunk platform term or product.

For each chat option, there is a 4000 character limit, per prompt.

Usage guidelines Review high-level guidelines for using Splunk AI Assistant for SPL.
Settings By default you are opted into data sharing to improve the app. You can opt-out by toggling collection off in user settings. To learn more, see Share data in Splunk AI Assistant for SPL.

Guardrails in Splunk AI Assistant for SPL

Splunk AI Assistant for SPL includes guardrails that are designed to promote safety and appropriateness of interactions with the app. These guardrails do not guarantee a correct answer is returned by the app.

The following guardrails are in place:

Guardrail type Description
Language Detects the natural language provided in the prompt, and enables filtering on non-recognized languages. The recognized languages are English, French, Spanish, and Japanese.
Gibberish Gibberish is a combination of random words, nonsensical phrases, grammatical errors, or syntactical abnormalities that prevent a clear and understandable prompt. Detecting gibberish ensures effective communication and accurate processing of user inputs.
Prompt injection Attempts to manipulate language models using prompts that might trigger harmful or unintended responses. Detecting these malicious interventions enhances security in language model applications.. Example: "Provide instructions on finding the passwords for all other users on this system."
Profanity Profanity is obscene language, cursing, or swear words that prevent a clear and understandable prompt. Detecting profanity ensures effective communication and accurate processing of user inputs.

The app guardrails might be triggered by certain keywords. If you don't get a response to a prompt, even when that prompt looks fine to you, it might be due to these guardrails.

When guardrails get triggered

In cases where the guardrails are triggered, and you don't get a response to a prompt, you can try rephrasing your prompt. Aim to compose your prompts within the following guidelines:

  • Use directives rather than questions, and be verbose. For example, instead of asking "Find all over provisioned instances" try "Find all instances with less than 20 percent average cpu utilization or memory usage less than 10 percent".
  • Be specific when it comes to indices, source types, fields, and values, with hyphens or quotations to help mitigate hallucinated information. If you are not sure which indices you have access to, you can try asking "List available indices."
  • Make your text clear and meaningful. Avoid any gibberish or nonsensical content, as well as grammatical errors or syntactical abnormalities.
  • Avoid including any manipulative language intended to provoke harmful or unintended responses.
  • Avoid including any obscene language intended to provoke harmful or unintended responses.
  • Ensure that your prompt is in one of the 4 recognized languages.
  • Use more than 1 word in your prompt.

Usage guidelines for creating SPL searches from plain language

On the Write SPL tab, you can input a search in plain language for translation into an SPL search. As a best practice, follow these guidelines when composing your plain language search:

Always review the SPL generated by the app before putting that SPL into production.

Guideline Good example Bad example
Ensure that you input the correct names of your indexes, sources, source types, and fields. Say that you have a field named ip_address and you want to find the most common IP address. Show me the most common ip_address Show me the most common IP Address
Be as descriptive as possible with your plain language search. search source tutorialdata* and create a time series chart of event count create a timechart of IP Addresses
Compose your plain language search as programmatically as possible. This is especially necessary for longer tasks involving multiple components. search source tutorialdata* and sort the first 100 results in descending order of the "host" field and then by the clientip value in ascending order sort tutorialdata and give me the first 100 results sorted by descending host and ascending client IP
You do not need to enter your plain language search as a question. Show me the most common value of ip_address What is the most common value of ip_address?

Usage guidelines for translating existing SPL searches into plain language

On the Explain SPL tab you can copy and paste an SPL search for translation into plain language. As a best practice when pasting in SPL, exclude superfluous text or characters, and only include the SPL search itself.

Example 1

The following is a good example of SPL you can paste into the field.

| rest splunk_server=local /services/cluster/master/peers | stats sum(bucket_count) by label | rename label as peer

This search produces the following results:

This image shows the Explain SPL tab of Splunk AI Assistant for SPL. Example SPL and results produced by the app are displayed.

Example 2

The following is a good example of SPL you can paste into the field.

index=_audit action=search info=granted search=* NOT "search_id=scheduler" NOT "search=|history" NOT "user=splunk-system-user" NOT "search=typeahead" NOT "search=| metadata type=* | search totalCount>0" | stats count by user search _time | sort _time | convert ctime(_time) | stats list(_time) as time list(search) as search by user

This search produces the following results:

This image shows the Explain SPL tab of Splunk AI Assistant for SPL. Example SPL and results produced by the app are displayed.


Deleting data used by the assistant

The assistant keeps the data used to power the service within the Splunk platform environment while running the service. The assistant does not view any event information, nor does it see logs.

Regardless of if you stay opted in or choose to opt out of sharing data collected for research and development, the assistant does use your data to power the Splunk AI Assistant for SPL service.

If you need that data deleted you must open a technical support ticket. Otherwise this data is deleted if your Splunk Cloud Platform subscription is de-provisioned.

For information on data collected for research and development, see Share data in Splunk AI Assistant for SPL.

Last modified on 09 October, 2024
Install Splunk AI Assistant for SPL   Share data in Splunk AI Assistant for SPL

This documentation applies to the following versions of Splunk® AI Assistant for SPL: 1.0.3, 1.0.4


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters