<?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: Selective display of values after transpose in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703953#M238573</link>
    <description>&lt;P&gt;And I will give you another approach.&lt;/P&gt;&lt;PRE&gt;| makeresults format=csv data="field1,field2,field3,field4,fiel5,field6,field7,field8,field9,field10,field11&lt;BR /&gt;sys1,2,a,v,4,65,2,dd,2,f,44&lt;BR /&gt;sys2,2,b,v,4,55,2,dd,2,f,44"&lt;BR /&gt;| appendpipe &lt;BR /&gt;   [ | stats dc(*) as * &lt;BR /&gt;     | eval field1="count"]&lt;BR /&gt;| transpose 0 header_field=field1&lt;/PRE&gt;&lt;P&gt;Now you can decide whether to include only those rows where you have one or two different values.&lt;/P&gt;&lt;P&gt;You can play with this to account for more rows and such.&lt;/P&gt;&lt;P&gt;And I'm assuming your sys1,sys2 names can be dynamic. Otherwise your solution would be as simple as&lt;/P&gt;&lt;PRE&gt;| where sys1=sys2&lt;/PRE&gt;&lt;P&gt;(or NOT)&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2024 19:01:38 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-11-08T19:01:38Z</dc:date>
    <item>
      <title>Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703855#M238533</link>
      <description>&lt;P&gt;This is similar to a question I asked earlier today that was quickly answered, however I'm not sure if I can apply that solution to this due to the transpose.&amp;nbsp; Not sure how to reference the data correctly for that.&lt;/P&gt;
&lt;P&gt;We have data with 10-15 fields in it and we are doing a transpose like the below.&amp;nbsp; What we are looking to accomplish is to display only the rows where the values are the same, or alternatively where they are different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=idx1 source="src1"
| table field1 field2 field3 field4 field5 field6 field7 field8 field9 field10
| transpose header_field=field1&lt;/LI-CODE&gt;
&lt;P&gt;column&amp;nbsp; &amp;nbsp; sys1&amp;nbsp; &amp;nbsp; sys2&lt;BR /&gt;field2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b&lt;BR /&gt;field3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;BR /&gt;field4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a&lt;BR /&gt;field5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;BR /&gt;field6 &amp;nbsp; &amp;nbsp; &amp;nbsp; c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;BR /&gt;field7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20&lt;BR /&gt;field8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d&lt;BR /&gt;field9&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;BR /&gt;field10&amp;nbsp; &amp;nbsp; 20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 22:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703855#M238533</guid>
      <dc:creator>kenbaugher</dc:creator>
      <dc:date>2024-11-07T22:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703881#M238545</link>
      <description>&lt;P&gt;I am confused as to how using transpose can changes anything. &amp;nbsp;The solution should be the same no matter how you obtain the table. &amp;nbsp;The following will pick up rows with equal values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx1 source="src1"
| table field1 field2 field3 field4 field5 field6 field7 field8 field9 field10
| transpose header_field=field1
| foreach sys*
    [eval _row_values = mvappend(_row_values, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]
| where mvcount(mvdedup(_row_values)) == 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using your sample data, the result is&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;column&lt;/TD&gt;&lt;TD&gt;sys1&lt;/TD&gt;&lt;TD&gt;sys2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;field3&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;field4&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;field6&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;field7&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;field9&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Here is an emulation for you to play with and compare with real data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="column,    sys1,    sys2
field2,       a,            b
field3,      10,         10
field4,       a,           a
field5,       10,         20
field6,       c,           c
field7,       20,         20
field8,       a,           d
field9,      10,         10
field10,    20,        10"
``` the above emulates
index=idx1 source="src1"
| table field1 field2 field3 field4 field5 field6 field7 field8 field9 field10
| transpose header_field=field1
```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 05:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703881#M238545</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-11-08T05:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703909#M238558</link>
      <description>&lt;P&gt;The transpose doesn't make a huge difference (as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;suggested), the solution is similar to your previous question, just with a change of field name.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=idx1 source="src1"
| table field1 field2 field3 field4 field5 field6 field7 field8 field9 field10
| transpose 0 header_field=field1
| untable column sysname value_info
| eventstats dc(value_info) as distinct_values by column
| where distinct_values &amp;gt; 1
| xyseries column sysname value_info&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Nov 2024 09:53:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703909#M238558</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-11-08T09:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703923#M238567</link>
      <description>&lt;P&gt;Thank you the below seems to work, however, for some reason the search only shows sys1 thru sys5.&amp;nbsp; &amp;nbsp;It does not matter which how many rows I put in the data, it won't show more than 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults format=csv data="field1, field2, field3, field4, field4, field5, field6, field7, field8, field9&lt;BR /&gt;sys1,10,a,10,c,20,a,10,20&lt;BR /&gt;sys2,20,b,10,c,20,a,10,20&lt;BR /&gt;sys3,10,c,10,c,20,a,10,20&lt;BR /&gt;sys4,30,d,10,c,20,a,10,20&lt;BR /&gt;sys5,40,a,10,c,20,a,10,20&lt;BR /&gt;sys6,20,c,10,c,20,a,10,20&lt;BR /&gt;sys7,50,d,10,c,20,a,10,20&lt;BR /&gt;sys8,10,e,10,c,20,a,10,20"&lt;BR /&gt;| table field1 field2 field3 field4 field5 field6 field7 field8 field9&lt;BR /&gt;| transpose header_field=field1| foreach *&lt;BR /&gt;[eval _row_values = mvappend(_row_values, &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)]&lt;BR /&gt;| where mvcount(mvdedup(_row_values)) != 1&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 13:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703923#M238567</guid>
      <dc:creator>kenbaugher</dc:creator>
      <dc:date>2024-11-08T13:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703943#M238572</link>
      <description>&lt;P&gt;The transpose command has an int argument which defaults to 5 - this is why I have used zero (0) in my suggested solution.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transpose" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transpose&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 16:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703943#M238572</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-11-08T16:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Selective display of values after transpose</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703953#M238573</link>
      <description>&lt;P&gt;And I will give you another approach.&lt;/P&gt;&lt;PRE&gt;| makeresults format=csv data="field1,field2,field3,field4,fiel5,field6,field7,field8,field9,field10,field11&lt;BR /&gt;sys1,2,a,v,4,65,2,dd,2,f,44&lt;BR /&gt;sys2,2,b,v,4,55,2,dd,2,f,44"&lt;BR /&gt;| appendpipe &lt;BR /&gt;   [ | stats dc(*) as * &lt;BR /&gt;     | eval field1="count"]&lt;BR /&gt;| transpose 0 header_field=field1&lt;/PRE&gt;&lt;P&gt;Now you can decide whether to include only those rows where you have one or two different values.&lt;/P&gt;&lt;P&gt;You can play with this to account for more rows and such.&lt;/P&gt;&lt;P&gt;And I'm assuming your sys1,sys2 names can be dynamic. Otherwise your solution would be as simple as&lt;/P&gt;&lt;PRE&gt;| where sys1=sys2&lt;/PRE&gt;&lt;P&gt;(or NOT)&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 19:01:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Selective-display-of-values-after-transpose/m-p/703953#M238573</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-11-08T19:01:38Z</dc:date>
    </item>
  </channel>
</rss>

