Reporting

How to build a report using if condition

zeaxodarap
Explorer

Now I have two fields(named field 1 and field 2) for one log file. Field 2 just has two kinds of value "1" and "2". I want to build a chart to show field 1's value when field 2's value equals "1". How can I do that? Thanks for any help!

Tags (1)
0 Karma

bwooden
Splunk Employee
Splunk Employee

One way...

... | where field2=1 | table field1

zeaxodarap
Explorer

eh...quite easy...I'm not familiar with Splunk search language...Thank u

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Or just: source=mylog field2=1 | ...

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[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 ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...