<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic format output based on IF condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/format-output-based-on-IF-condition/m-p/504774#M140974</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| pivot mongo ServerStatus max(currentConnections) SPLITCOL host 
| fieldsummary 
| fields field, max 
| rename field as host, max as max_host 
| stats sum(max_host) as Total 
| search Total&amp;gt;20000&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This&amp;nbsp; above is displaying&amp;nbsp; the total number of connections as expected&lt;/P&gt;&lt;P&gt;i want to add a if condition like whenever i met this condition i want to display connections per host as per below query. i tried including the search inside but this is not helping in my case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eval flag=if(condition, [SEARCH QUERY], null()) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| pivot mongo ServerStatus max(currentConnections) SPLITCOL host 

| fieldsummary | fields field , max

| rename field AS host, max AS max_host

| eval host=host." (".max_host.")" 

| fields host

| mvcombine delim=" , " host

| nomv host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Result:&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;host1 (1414)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host2 (1415)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host3&amp;nbsp; (1416)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host4&amp;nbsp; (3532)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Both Queries are working as expected but i'm looking if i can connect them on condition like execute query 2 only on condition of Total connections exceed.&lt;/P&gt;&lt;P&gt;Any help is appreciated , thank you&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 11:52:35 GMT</pubDate>
    <dc:creator>r0ckyte</dc:creator>
    <dc:date>2020-06-17T11:52:35Z</dc:date>
    <item>
      <title>format output based on IF condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/format-output-based-on-IF-condition/m-p/504774#M140974</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| pivot mongo ServerStatus max(currentConnections) SPLITCOL host 
| fieldsummary 
| fields field, max 
| rename field as host, max as max_host 
| stats sum(max_host) as Total 
| search Total&amp;gt;20000&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This&amp;nbsp; above is displaying&amp;nbsp; the total number of connections as expected&lt;/P&gt;&lt;P&gt;i want to add a if condition like whenever i met this condition i want to display connections per host as per below query. i tried including the search inside but this is not helping in my case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eval flag=if(condition, [SEARCH QUERY], null()) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| pivot mongo ServerStatus max(currentConnections) SPLITCOL host 

| fieldsummary | fields field , max

| rename field AS host, max AS max_host

| eval host=host." (".max_host.")" 

| fields host

| mvcombine delim=" , " host

| nomv host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Result:&lt;/P&gt;&lt;DIV class="multivalue-subcell"&gt;host1 (1414)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host2 (1415)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host3&amp;nbsp; (1416)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;host4&amp;nbsp; (3532)&lt;/DIV&gt;&lt;DIV class="multivalue-subcell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Both Queries are working as expected but i'm looking if i can connect them on condition like execute query 2 only on condition of Total connections exceed.&lt;/P&gt;&lt;P&gt;Any help is appreciated , thank you&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/format-output-based-on-IF-condition/m-p/504774#M140974</guid>
      <dc:creator>r0ckyte</dc:creator>
      <dc:date>2020-06-17T11:52:35Z</dc:date>
    </item>
  </channel>
</rss>

