Splunk Search

Searching for punct field values

landen99
Motivator

As the title reveals, I am trying to search the punct field for specific values. The punct field is naturally tricky because it includes quotation marks, dashes, and other unique characters which naturally yield search errors or throw off the search.

The search below is most likely incorrect but serves to clarify the task and an example string including problematic characters:

| search punct="___::_..__--::_..__-_-_-___:__="_':\__()\_\_\.\\.'"

The most obvious problem with this string is the double quotation mark in the middle of the string. These strings vary in form with each event record and different strings may be desired for the punct search.

In summary, how do I search the event records for specific punct field values?

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You need to escape double quotes and backslashes with a backslash, then you can search for punct values like any other field="value".

View solution in original post

0 Karma

landen99
Motivator

This is for a normal search (currently).

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You need to escape double quotes and backslashes with a backslash, then you can search for punct values like any other field="value".

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

If that's your entire search then you should leave off the | search.

0 Karma

landen99
Motivator

Are you saying that the search for the string in the field above would look like this?:

| search punct="___::_..__--::_..__-_-_-___:__=\"_':\\__()\\_\\_\\.\\\\.'"
0 Karma

somesoni2
Revered Legend

Based on the punct values I see in my logs, double qoutes is the only problematic character. You can escape it with a backward slash (\). How are you providing your punct filters, through dashboard/form input?

0 Karma
Get Updates on the Splunk Community!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...