<?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 Data Model Columns and Rows Transpose using Eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383847#M112111</link>
    <description>&lt;P&gt;Hello-&lt;BR /&gt;
How do you transpose columns inside the Data Model using eval?&lt;BR /&gt;&lt;BR /&gt;
My goal is to filter a column called column1 inorder to extract data from a second column called column2. A third column would be created to only hold vales transferred from the second column. The name of this column would be column3.&lt;/P&gt;

&lt;P&gt;column1&lt;BR /&gt;
filter1&lt;BR /&gt;
filter2&lt;BR /&gt;
filter3&lt;/P&gt;

&lt;P&gt;column2&lt;BR /&gt;
data1&lt;BR /&gt;
data2&lt;BR /&gt;
data3&lt;/P&gt;

&lt;P&gt;column3&lt;BR /&gt;
null&lt;BR /&gt;
data2&lt;BR /&gt;
null&lt;/P&gt;

&lt;P&gt;This code pulls the value randomly:&lt;/P&gt;

&lt;P&gt;|eval   if(like(column1,"filter2"),column2,NULL)&lt;/P&gt;

&lt;P&gt;Field Name = column3&lt;/P&gt;

&lt;P&gt;I need to extract the value from column2 using the same row referenced in column1.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2019 00:34:28 GMT</pubDate>
    <dc:creator>TreeHut</dc:creator>
    <dc:date>2019-02-15T00:34:28Z</dc:date>
    <item>
      <title>Data Model Columns and Rows Transpose using Eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383847#M112111</link>
      <description>&lt;P&gt;Hello-&lt;BR /&gt;
How do you transpose columns inside the Data Model using eval?&lt;BR /&gt;&lt;BR /&gt;
My goal is to filter a column called column1 inorder to extract data from a second column called column2. A third column would be created to only hold vales transferred from the second column. The name of this column would be column3.&lt;/P&gt;

&lt;P&gt;column1&lt;BR /&gt;
filter1&lt;BR /&gt;
filter2&lt;BR /&gt;
filter3&lt;/P&gt;

&lt;P&gt;column2&lt;BR /&gt;
data1&lt;BR /&gt;
data2&lt;BR /&gt;
data3&lt;/P&gt;

&lt;P&gt;column3&lt;BR /&gt;
null&lt;BR /&gt;
data2&lt;BR /&gt;
null&lt;/P&gt;

&lt;P&gt;This code pulls the value randomly:&lt;/P&gt;

&lt;P&gt;|eval   if(like(column1,"filter2"),column2,NULL)&lt;/P&gt;

&lt;P&gt;Field Name = column3&lt;/P&gt;

&lt;P&gt;I need to extract the value from column2 using the same row referenced in column1.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 00:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383847#M112111</guid>
      <dc:creator>TreeHut</dc:creator>
      <dc:date>2019-02-15T00:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Columns and Rows Transpose using Eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383848#M112112</link>
      <description>&lt;P&gt;Why use LIKE? Is not this a ”filter2%”?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 02:25:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383848#M112112</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-02-15T02:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Columns and Rows Transpose using Eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383849#M112113</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval _raw="column1='filter1 filter2 filter3' column2='data1 data2 data3'"
| kv
| foreach column* [ rex field=&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; mode=sed "s/'//g" | makemv &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; ]
| eval filter="filter2"
| eval column3 = mvindex(column2, mvfind(column1, filter))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 04:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Data-Model-Columns-and-Rows-Transpose-using-Eval/m-p/383849#M112113</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-15T04:59:42Z</dc:date>
    </item>
  </channel>
</rss>

