<?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 Re: How to create a table row with all values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431120#M123237</link>
    <description>&lt;P&gt;@renjith.nair Yes it works. Many thanks. Did a stupid spelling mistake. &lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 12:37:04 GMT</pubDate>
    <dc:creator>vbotnari1</dc:creator>
    <dc:date>2019-06-21T12:37:04Z</dc:date>
    <item>
      <title>How to create a table row with all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431116#M123233</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have the following table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP             |      Event    |      Bad
10.10.10.1     |      fail     |
10.10.10.1     |               |      malicious
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The result should look like 10.10.10.1 fail malicious.&lt;BR /&gt;
I have to display the IP value only if it has both Event and bad values&lt;/P&gt;

&lt;P&gt;In my search, an IP cannot have both Event and Bad values in the same row. I need to extract from the table if the same IP has both Event and Bad values in different rows and they display as I single row with all values. I hope this makes sense&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 11:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431116#M123233</guid>
      <dc:creator>vbotnari1</dc:creator>
      <dc:date>2019-06-21T11:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table row with all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431117#M123234</link>
      <description>&lt;P&gt;@vbotnari1 &lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"your current search"
| stats values(Event) as Event,values(Bad) as Bad by IP
| where isnotnull(Event) AND isnotnull(Bad)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 11:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431117#M123234</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-06-21T11:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table row with all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431118#M123235</link>
      <description>&lt;P&gt;@renjith.nair Thank you. But your search works for rows with both values.&lt;BR /&gt;
In my search an IP cannot have both Event and Bad values in the same row. I need to extract from the table if the same IP has both Event and Bad  values in different rows and them display as I single row with all values. I hope this makes sens &lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 11:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431118#M123235</guid>
      <dc:creator>vbotnari1</dc:creator>
      <dc:date>2019-06-21T11:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table row with all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431119#M123236</link>
      <description>&lt;P&gt;@vbotnari1,&lt;BR /&gt;
Yes the second line &lt;CODE&gt;stats&lt;/CODE&gt; should do this for you. It picks up both values from events and group it with IP Isn't working ?&lt;/P&gt;

&lt;P&gt;Here is the dummy search I used&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval IP="10.10.10.1 10.10.10.1 10.10.10.2 10.10.10.2"| makemv IP| mvexpand IP
| appendcols  [| makeresults | eval Event="Fail,,,Fail,," | makemv Event delim=","| mvexpand Event]
| appendcols [| makeresults| eval Bad=" ,malicious,,virus,"| makemv Bad delim=","| mvexpand Bad]
| table IP,Event,Bad | eval Bad=if(Bad==" ",null(),Bad)| eval Event=if(Event==" ",null(),Event)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then the &lt;CODE&gt;stats&lt;/CODE&gt; and &lt;CODE&gt;where&lt;/CODE&gt; added to it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats values(Event) as Event,values(Bad) as Bad by IP
 | where isnotnull(Event) AND isnotnull(Bad)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please let me know if it's not matching with your dataset&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 12:23:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431119#M123236</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-06-21T12:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table row with all values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431120#M123237</link>
      <description>&lt;P&gt;@renjith.nair Yes it works. Many thanks. Did a stupid spelling mistake. &lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 12:37:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-row-with-all-values/m-p/431120#M123237</guid>
      <dc:creator>vbotnari1</dc:creator>
      <dc:date>2019-06-21T12:37:04Z</dc:date>
    </item>
  </channel>
</rss>

