<?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: List element by a specific value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629762#M218778</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243486"&gt;@sdhiaeddine&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if these ields are already correctly extracted you can put the condition in the main search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index Age="21"
| table Name Age Address&lt;/LI-CODE&gt;&lt;P&gt;if the fields aren0t already extracted, you should share some samples of your logs to create the extracting regex.&lt;/P&gt;&lt;P&gt;i hint to follow the Splunk Search Tutorial (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial)" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial)&lt;/A&gt;&amp;nbsp;to be authonomous in this kind of searches&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 16:15:13 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-02-06T16:15:13Z</dc:date>
    <item>
      <title>How to list element by a specific value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629761#M218777</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have this table of data:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Name&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Age&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Address&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Mark&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;21&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;1 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Elisabeth&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;21&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Jane&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;22&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;3 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;Bryan&lt;/TD&gt;
&lt;TD height="25px"&gt;24&lt;/TD&gt;
&lt;TD height="25px"&gt;4 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to list only the elements having a specific age. Exp: list of person with Age=21&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Name&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Age&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Address&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Mark&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;21&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;1 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Elisabeth&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;21&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2 st xxxxx&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 17:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629761#M218777</guid>
      <dc:creator>sdhiaeddine</dc:creator>
      <dc:date>2023-02-06T17:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: List element by a specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629762#M218778</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243486"&gt;@sdhiaeddine&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if these ields are already correctly extracted you can put the condition in the main search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index Age="21"
| table Name Age Address&lt;/LI-CODE&gt;&lt;P&gt;if the fields aren0t already extracted, you should share some samples of your logs to create the extracting regex.&lt;/P&gt;&lt;P&gt;i hint to follow the Splunk Search Tutorial (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial)" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial)&lt;/A&gt;&amp;nbsp;to be authonomous in this kind of searches&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 16:15:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629762#M218778</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-06T16:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: List element by a specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629763#M218779</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Actually I run this to extract the data from a json like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"list_element": [
		{
			"Address": "3 st xxxxx",
			"Age": "22",
			"Name": "Jane"
		},
		{
			"Address": "2 st xxxxx",
			"Age": "21",
			"Name": "Elisabeth"
		},
		{
			"Address": "1 st xxxxx",
			"Age": "21",
			"Name": "Mark"
		}
	]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;index=* | stats values(list_element) as list_element by database&lt;BR /&gt;| spath input=list_element&lt;BR /&gt;| table Name Age Address&lt;BR /&gt;&lt;BR /&gt;I guess, I need to set a condition after the "spath"?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 16:23:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629763#M218779</guid>
      <dc:creator>sdhiaeddine</dc:creator>
      <dc:date>2023-02-06T16:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: List element by a specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629764#M218780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243486"&gt;@sdhiaeddine&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the spath ommand must be before the stats command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* 
| spath 
| where Age="21"
| table Name Age Address&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* 
| spath 
| stats max(Age) AS Age values(Address) AS Address BY Name
| where Age="21"
| table Name Age Address&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 16:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-element-by-a-specific-value/m-p/629764#M218780</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-06T16:27:37Z</dc:date>
    </item>
  </channel>
</rss>

