<?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 change value of an attribute using condition before indexing? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623042#M107229</link>
    <description>&lt;P&gt;There are ways to define additional indexed fields but they should be used as rarely as possible. Your case seems as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; pointed out more like an issue that can be solved with search-time lookup.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 15:42:25 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-12-02T15:42:25Z</dc:date>
    <item>
      <title>How to change value of an attribute using condition before indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623037#M107226</link>
      <description>&lt;P&gt;Hi, I want to index simple xml file.&lt;/P&gt;
&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR /&gt;&amp;lt;unitData xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" rel="noopener"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" target="_blank" rel="noopener"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xsi:noNamespaceSchemaLocation="unitData-1.0.xsd" unit="0000006000" equipment="W052A-22G0014" operator="admin" starttime="2022-11-22T06:10:53+01:00" endtime="2022-11-22T06:15:07+01:00" state="ok"&amp;gt;&lt;BR /&gt;&amp;lt;/unitData&amp;gt;&lt;/P&gt;
&lt;P&gt;Before indexing I would like to create new additional attribute &lt;STRONG&gt;&lt;EM&gt;machine&lt;/EM&gt;&lt;/STRONG&gt; which should have value depended of these conditions:&lt;/P&gt;
&lt;P&gt;case equipment="W052A-22G0014" &lt;STRONG&gt;&lt;EM&gt;machine&lt;/EM&gt;&lt;/STRONG&gt; =machine1&lt;/P&gt;
&lt;P&gt;case equipment="W052A-22G0013" &lt;STRONG&gt;&lt;EM&gt;machine&lt;/EM&gt;&lt;/STRONG&gt; =machine2&lt;/P&gt;
&lt;P&gt;Can anybody help, please?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623037#M107226</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2022-12-02T15:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623038#M107227</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/189417"&gt;@spisiakmi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;why create this field before indexing?&lt;/P&gt;&lt;P&gt;You can create a calculated field at Search Time so you haven't to modify logs and it's easier.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623038#M107227</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-02T15:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623042#M107229</link>
      <description>&lt;P&gt;There are ways to define additional indexed fields but they should be used as rarely as possible. Your case seems as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; pointed out more like an issue that can be solved with search-time lookup.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 15:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623042#M107229</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-12-02T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623045#M107230</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I try &lt;SPAN&gt;calculated field definitely. If you have a time to help me with it, it would be perfect. In this exact example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;m&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 16:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623045#M107230</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2022-12-02T16:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623054#M107233</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/189417"&gt;@spisiakmi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to test and find the eval field calculation and then save it as a calculated field.&lt;/P&gt;&lt;P&gt;in your case you should try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval machine=case(equipment="W052A-22G0014","machine1", equipment="W052A-22G0013","machine2")&lt;/LI-CODE&gt;&lt;P&gt;if the transformation correctly runs in the search, you can sate it in [Settings &amp;gt; Fields &amp;gt; Calculated Field &amp;gt; New Field] inserting the field name (machine) and the transformation.&lt;/P&gt;&lt;P&gt;Remember that you have to find a sourcetype to associate the transformation.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 17:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623054#M107233</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-02T17:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623405#M107267</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanna thank you very much. Your solution with calculated field was brilliant. Very simple and effective. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 11:09:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623405#M107267</guid>
      <dc:creator>spisiakmi</dc:creator>
      <dc:date>2022-12-06T11:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to change value of an attribute using condition before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623407#M107268</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/189417"&gt;@spisiakmi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 11:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-value-of-an-attribute-using-condition-before/m-p/623407#M107268</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-12-06T11:11:38Z</dc:date>
    </item>
  </channel>
</rss>

