<?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 field with selected values of the same field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410028#M118267</link>
    <description>&lt;P&gt;If this answerd your question @umsundar2015, please mark it as closed/upvote.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 12:54:19 GMT</pubDate>
    <dc:creator>vik_splunk</dc:creator>
    <dc:date>2019-01-21T12:54:19Z</dc:date>
    <item>
      <title>How to create a field with selected values of the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410026#M118265</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I have OS field which has many rows  .In that i need to filter only the below values and create a field ,&lt;BR /&gt;
Windows Server 2012 R2 Standard&lt;BR /&gt;
Windows 7&lt;BR /&gt;
Windows Server 2012&lt;BR /&gt;
Windows 7 Enterprise&lt;BR /&gt;
Windows 10&lt;BR /&gt;
Microsoft Windows Server 2008 R2 Standard&lt;BR /&gt;
Microsoft Windows Server 2008 R2 Enterprise&lt;BR /&gt;
Microsoft Windows 2008 Server Standard&lt;BR /&gt;
Windows 8&lt;BR /&gt;
Windows 10 Enterprise&lt;/P&gt;

&lt;P&gt;When i use match function like ,&lt;BR /&gt;
eval OS=mvfilter(match(OS,"Windows Server 2012 R2 Standard") OR match(OS,"Windows Server 2012") OR match(OS,"Windows 7")) |stats count by OS&lt;/P&gt;

&lt;P&gt;I am getting other values "Windows 7 embedded " also which i dont need in the list of values.&lt;/P&gt;

&lt;P&gt;Please help to filter the exact values which i needed above.&lt;/P&gt;

&lt;P&gt;Thanks .&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 06:39:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410026#M118265</guid>
      <dc:creator>umsundar2015</dc:creator>
      <dc:date>2018-11-23T06:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with selected values of the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410027#M118266</link>
      <description>&lt;P&gt;Hi @umsundar2015 &lt;/P&gt;

&lt;P&gt;A few different ways to do this.&lt;/P&gt;

&lt;P&gt;1)Using replace : If your "other" options are limited, you could do something like below&lt;/P&gt;

&lt;P&gt;|replace "Windows 7 embedded" WITH "Windows 7" IN OS (You can use wild characters and multiple values to replace in one single command.&lt;/P&gt;

&lt;P&gt;Reference here : &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Replace"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/Replace&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;2)Using eval case : Spinning up an example without sample data is going to be difficult but a sample query will look like&lt;/P&gt;

&lt;P&gt;|eval OS=case(match(OS,"Windows 7 embedded"),"Windows 7,..... series of such match functions(or can use simple OS==),finally a default match)&lt;/P&gt;

&lt;P&gt;Reference here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/ConditionalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/7.2.1/SearchReference/ConditionalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 13:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410027#M118266</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2018-11-23T13:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with selected values of the same field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410028#M118267</link>
      <description>&lt;P&gt;If this answerd your question @umsundar2015, please mark it as closed/upvote.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 12:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-selected-values-of-the-same-field/m-p/410028#M118267</guid>
      <dc:creator>vik_splunk</dc:creator>
      <dc:date>2019-01-21T12:54:19Z</dc:date>
    </item>
  </channel>
</rss>

