Splunk Search

List almost-duplicates (in a variable?)

djm229
Engager

Hello.  I have a search that results in, amongst other things, fields that are ALMOST duplicates.  Example:

Bob: Task incomplete.

Steve: Task Incomplete.

George: Task Incomplete.

Fred: Task Complete.

Spock: Task Complete.

Is there a way to generate a table which results in:

| Task Status           |  Team Player Responsible |

| Task Complete    |  Fred, Spock                            |

| Task Incomplete |  Bob, Steve, George              |

For each instance of "Task Complete" and "Task Incomplete", I want to know which Persons to tag in a simple table without listing every user in a giant list.

I've looked into dedup, uniq and sub-searches but haven't figured out how to list the non-duplicated parts next to a single instance of the duplicated part.

[Insert deity], I hope that made sense.  Help?

Labels (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @djm229,

I assumed your usernames and task status is in the same field. If not rex command is unnecessary;

Please try below by updating your <your_field> with field that contains your sample values;

| rex field=<your_field> "(?<user>[^:]+):\s(?<task_status>.+)"
| stats values(user) by task_status

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

djm229
Engager

Thanks, I'll have to modify the regex to make it (and the rest of my query) fit together.  If it works, I'll tag as "the Solution".  Very much appreciate it - even if it doesn't work.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...