<?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 restrict search results to columns wanted in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490801#M137028</link>
    <description>&lt;P&gt;Sweet! Thank you.  Now I need to figure out how to format my dashboard to just have the title of the column not be "metadata.x"&lt;BR /&gt;
where x = the metadata subcategory.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2019 20:14:32 GMT</pubDate>
    <dc:creator>jtpryan</dc:creator>
    <dc:date>2019-11-18T20:14:32Z</dc:date>
    <item>
      <title>How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490795#M137022</link>
      <description>&lt;P&gt;I have a search that returns a large amount of information in each row, resulting in many columns, most of which I don't want in this dashboard.  &lt;/P&gt;

&lt;P&gt;How do I restrict it to the columns I want?  &lt;/P&gt;

&lt;P&gt;For example: &lt;STRONG&gt;User, Stack_Name, Functional_Area, Squad.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490795#M137022</guid>
      <dc:creator>jtpryan</dc:creator>
      <dc:date>2020-09-30T03:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490796#M137023</link>
      <description>&lt;P&gt;Hi @jtpryan&lt;BR /&gt;
did you explored the table command?&lt;/P&gt;

&lt;P&gt;So, please, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_search
| table User Stack_Name Functional_Area Squad
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more infos see at &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Table"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Table&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490796#M137023</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-11-18T15:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490797#M137024</link>
      <description>&lt;P&gt;Hi Jtpryan,&lt;/P&gt;

&lt;P&gt;You could use either "table" command or "fields" commands to include or exclude fields.&lt;/P&gt;

&lt;P&gt;1)Table command&lt;BR /&gt;
  This is a transforming command and will include only the fields which are mentioned in the command.&lt;/P&gt;

&lt;P&gt;Only User, Stack_Name, Functional_Area, Squad will get displayed as per below example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|your_search
|table User, Stack_Name, Functional_Area, Squad
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2)Fields command&lt;BR /&gt;
    This is used to either include or exclude any fields.Also displays the internal fields - with underscores like _time,useful to plot &lt;BR /&gt;
    charts in some cases.Uses + and - symbols to specify inclusion or exclusion.&lt;/P&gt;

&lt;P&gt;Only User, Stack_Name, Functional_Area, Squad will get displayed and the internals fields are available to use.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|your_search
|fields + User, Stack_Name, Functional_Area, Squad
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All fields EXCEPT User, Stack_Name, Functional_Area, Squad will get displayed&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|your_search
|fields - User, Stack_Name, Functional_Area, Squad.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Happy Splunking!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490797#M137024</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2020-09-30T03:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490798#M137025</link>
      <description>&lt;P&gt;Great Info.  I tried table and it looks like it is exactly what I want.  However, while it returns the columns I need, there is no data in them.  The data is in the "events" visualizations, so I know it exists.  Is it because those fields are under "metadata"?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7982i9D12209B2D4370E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:54:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490798#M137025</guid>
      <dc:creator>jtpryan</dc:creator>
      <dc:date>2019-11-18T15:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490799#M137026</link>
      <description>&lt;P&gt;Hi JtPryan,&lt;/P&gt;

&lt;P&gt;Great!!&lt;BR /&gt;
Looks likes your source data is in JSON format.&lt;BR /&gt;
Could you please try parsing the data.You could use "spath " command as below.&lt;/P&gt;

&lt;P&gt;|index="" sourcetype=""&lt;BR /&gt;
 |spath input =_raw&lt;BR /&gt;
 |your_search&lt;BR /&gt;
 |table User, Stack_Name, Functional_Area, Squad&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:05:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490799#M137026</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2020-09-30T03:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490800#M137027</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{ \"build_number\": 546,
\"build_url\": \"blar\",
\"event_tab\": \"build_report\",
\"job_name\": \"blar\",
\"job_result\": \"SUCCESS\",
\"metadata\": {
\"FUNCTOONAL_AREA\": \"DevOps\",
\"JMX_FILE\": \"Sample-Test-Plan/sendMessageTest\",
\"REQUIRED_LGS\": 1,
\"SQUAD_NAME\": \"SquadNameChong\",
\"STACK_NAME\": \"DevOps-jmeter\",
\"TEST_REPO_BRANCH\": \"feature/EFORTS\",
\"scm\": \"git\" },
\"page_num\": 1,
\"testsuite\": { },
\"user\": \"blar\" }"
| spath
| table metadata* user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, The field name under &lt;EM&gt;metadata&lt;/EM&gt; is&lt;BR /&gt;
&lt;STRONG&gt;metadata. &lt;EM&gt;fieldname&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 17:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490800#M137027</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-18T17:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490801#M137028</link>
      <description>&lt;P&gt;Sweet! Thank you.  Now I need to figure out how to format my dashboard to just have the title of the column not be "metadata.x"&lt;BR /&gt;
where x = the metadata subcategory.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 20:14:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490801#M137028</guid>
      <dc:creator>jtpryan</dc:creator>
      <dc:date>2019-11-18T20:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict search results to columns wanted</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490802#M137029</link>
      <description>&lt;P&gt;Hi jtpryan,&lt;BR /&gt;
You could use rename command to change display name.&lt;/P&gt;

&lt;P&gt;|index="" sourcetype=""&lt;BR /&gt;
|spath input =_raw&lt;BR /&gt;
|your_search&lt;BR /&gt;
|table User, metadata.Stack_Name, metadata.Functional_Area, metadata.Squad&lt;BR /&gt;
|rename metadata.Stack_Name as Stack_Name,metadata.Functional_Area as Functional_Area, metadata.Squad as Squad.&lt;/P&gt;

&lt;P&gt;Please accept and upvote answers if it solved your issue.&lt;/P&gt;

&lt;P&gt;Happy Splunking!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-restrict-search-results-to-columns-wanted/m-p/490802#M137029</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2020-09-30T03:05:56Z</dc:date>
    </item>
  </channel>
</rss>

