Splunk Search

Can you help us build a query that removes null values from a table?

roopeshetty
Path Finder

Hi guys,

Our search query is like this

LogName=Application SourceName=Script | rex "Days Remaining: (?.*)days" | rex ": Origin=(?.+?)\," | rex (?.+?)\; | table CertificateName, DaysRemaining

Output will provide us a table with 2 columns as “CertificateName” and “DaysRemaining” in which “CertificateName” will have the names of the Certificates and “DaysRemaining” will have the days left for certificate expiry.

But sometimes, the “DaysRemaining” column will have not any numbers for few of the “CertificateNames” and remains blank as attached here in the screen shot.

Is there any way...

  1. We can remove the rows which have no values (blank rows) using the above query?
  2. Can we input some text string like “Not Available” where ever we have these null values using the above query?

Please advise.

0 Karma

vnravikumar
Champion

Hi @roopeshetty

Try like

LogName=Application SourceName=Script | rex "Days Remaining: (?.)days" | rex ": Origin=(?.+?)\," | rex (?.+?)\; |search DaysRemaining=* | table CertificateName, DaysRemaining

This will remove null row of DaysRemaining

0 Karma

vnravikumar
Champion

you can try | fillnull value="Not Available" DaysRemaining

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...