<?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 use &amp;quot;setfields&amp;quot; command to assign the value based on field value rather than field name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511625#M143435</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I think that eval is better on this case.&lt;/P&gt;&lt;P&gt;eval fieldA = fieldB&amp;nbsp;&lt;/P&gt;&lt;P&gt;is enough to copy fieldB values to fieldA.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 20:09:27 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2020-07-29T20:09:27Z</dc:date>
    <item>
      <title>How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511618#M143430</link>
      <description>&lt;P&gt;I want to use the setfields command to set fieldA to a particular value.&amp;nbsp; That value is located in fieldB.&amp;nbsp; How can I make setfields take the value of the field rather then the field name.&amp;nbsp; setfields fieldA=fieldB sets A to the string "fieldB".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 19:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511618#M143430</guid>
      <dc:creator>sirching</dc:creator>
      <dc:date>2020-07-29T19:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511625#M143435</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I think that eval is better on this case.&lt;/P&gt;&lt;P&gt;eval fieldA = fieldB&amp;nbsp;&lt;/P&gt;&lt;P&gt;is enough to copy fieldB values to fieldA.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 20:09:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511625#M143435</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-29T20:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511630#M143438</link>
      <description>&lt;P&gt;My FieldA contains a mixture of 2 values, OSType and Null, total count is 587.&amp;nbsp; My Field B contains 1 value OSType and has a count of 4.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set the 587 count of FieldA values to value of the OSType.&amp;nbsp; &amp;nbsp;Based on this scenario, what do you suggest.&amp;nbsp; In the end I want all 587 FieldA values to equal the OSType, thus eliminating the Null value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 20:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511630#M143438</guid>
      <dc:creator>sirching</dc:creator>
      <dc:date>2020-07-29T20:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511634#M143441</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| eval FieldA=split("OStype,,OStypes,OStype,,OStype",",")
| mvexpand FieldA
| eval FieldA=nullif(FieldA,"")
| eval FieldB="OStype"
| rename COMMENT as "FieldA are OStype,OStypes and NULL"
| eventstats count(eval(FieldA=FieldB)) as count&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;stats() eventstats()&lt;/STRONG&gt; and &lt;STRONG&gt;chart()&lt;/STRONG&gt; can use &lt;STRONG&gt;eval&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 21:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511634#M143441</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-29T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511654#M143454</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;LI-CODE lang="java"&gt;| makeresults
| eval FieldA=split("OStype,,OStype,OStype,,OStype",",")
| mvexpand FieldA
| eval FieldA=nullif(FieldA,"")
| eval FieldB="OStype"
| rename COMMENT as "FieldA are OStype,OStypes and NULL"
| eval FieldA =  FieldB&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 22:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511654#M143454</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-29T22:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "setfields" command to assign the value based on field value rather than field name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511886#M143534</link>
      <description>&lt;P&gt;Can you post an example of your data. From your description I take it that you want to set fieldA=fieldB where fieldA is null. So, you could do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval fieldA=coalesce(fieldA, fieldB)&lt;/LI-CODE&gt;&lt;P&gt;which will copy fieldB to field A when field A is null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 05:11:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-setfields-quot-command-to-assign-the-value-based/m-p/511886#M143534</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-31T05:11:15Z</dc:date>
    </item>
  </channel>
</rss>

