NXLog Windows Events and Source - event-log

I want to upload events only from a "puppet" source, which is "Windows Logs\Application".
I guess I have to change the line <Select Path = 'Application'> * </Select>
How to filter source "puppet" in nxlog.conf?
<Input in>
Module im_msvistalog
ReadFromLast TRUE
<QueryXML>
<QueryList>
<Query Id='1'>
<Select Path='Application'>*</Select>
</Query>
</QueryList>
</QueryXML>
Exec $FileName = 'winapp.log';
Exec $EventTime = $EventReceivedTime;
</Input>
<Output out1>
Module om_udp
Host 10.10.0.40
Port 514
Exec to_syslog_bsd();
</Output>
<Route 1>
Path in => out1
</Route>

here's how i've done it :
<Query Id='1'>
<Select Path="Application">*[System[Provider[(#Name="MySrcName")]]]</Select>
</Query>
I found the tree path : System > Provider > Name
by opening the windows event viewer, then select your event, then event properties, then details.
I said that because it may be different for you based on your windows version.

Related

How to add multiselect in form

I am newbie in SalesForce Commerce Cloud. So if my question is silly then I am sorry in advance.
My Target is to show the multiselect on customer registration form. By searching on internet what I have done
Step 1: Add form definition
<field formid="brands" label="label.select.interestedbrands.preferences" type="integer" mandatory="true" binding="profile.interestedBrands">
<options>
<option optionid="1" label="Brand 1" value="1"/>
<option optionid="2" label="Brand 2" value="2" />
<option optionid="3" label="Brand 3" value="3" />
<option optionid="4" label="Brand 4" value="4" />
<option optionid="5" label="Brand 5" value="5" />
<option optionid="6" label="Brand 6" value="6" />
<option optionid="7" label="Brand 7" value="7" />
</options>
</field>
Step 2: In isml template file I have rendered it like this
<select class="custom-select form-control" id="brands" <isprint value="${pdict.preferencesForm.brands.attributes}" encoding="off" /> multiple>
<isloop items=${pdict.preferencesForm.brands.options} var="brand">
<option id="${brand.id}" value="${brand.htmlValue}" <isif condition="${brand.selected}">selected</isif> >${brand.label}</option>
</isloop>
</select>
To save it in the system object profile I have added one new attribute which type is Enum of Integer and multiselect true.
Problem: Now when I try to save the form in the controller it have only one value whether I select multiple options or not.
Can you please let me know how can I add the multi-select in the SFCC and which mistake I am doing?

how to edit single row in rich:dataTable

i have to edit a row in a table using rich faces 4 and modal panel. I am new one so please tell me in details and i know to make a table in rich faces. i already searched so many things but not getting any fruitful
See answer for question "Richfaces: show details in popup [commandbutton, action and popupPanel]". It works in RichFaces 4.x with rowClick.
Or here is example with commandLink:
<a4j:commandLink action="#{actionBean.setupTransactionDetails}"
event="onclick" render="transactionDetails"
oncomplete="#{rich:component('transactionDetails')}.show()"
styleClass="rich-link">
<h:outputText value="#{res.transactionType}" />
<f:setPropertyActionListener value="#{res.transactionId}"
target="#{profile.transactionId}" />
</a4j:commandLink>
But I prefer updated version like this:
<a4j:jsFunction name="showDetail" action="#{actionBean.setupTransactionDetails}"
oncomplete="#{rich:component('transactionDetails')}.show();"
render="transactionDetails">
<a4j:param name="id" assignTo="#{profile.transactionId}"
converter="javax.faces.Long" />
</a4j:jsFunction>
<rich:dataTable id="txnTable" rows="#{referenceData.recordsPerPage}"
style="width: 100%" rowClasses="oddrow, evenrow"
value="#{profile.transactions}" var="res" sortMode="single">
<h:column width="110">
<f:facet name="header">
<h:outputText value="#{msg.transactionType}" />
</f:facet>
<a4j:commandLink onclick="showDetail('#{res.transactionId}');"
value="#{res.transactionType}" />
</h:column>
</rich:dataTable>
<rich:popupPanel id="transactionDetails" autosized="true"
style="max-height:600px;">
<!-- f:facet name="header" and f:facet name="controls" here -->
<h:form id="transactionDetailsForm">
<!-- some details here -->
</h:form>
</rich:popupPanel>
Profile backing bean
private Long transactionId; // + getter and setter
Action backing bean
public void setupTransactionDetails() {
Transaction txn = DAO.getInstance().get(Transaction.class, getProfile().getTransactionId());
transactionForm.setup(txn);
}
In case if you use EL 2.2 (or higher) you can call action bean method with parameter.

how to populate a drop down(<s:select) in struts2 from json response

i am unable to populate my Struts2 select drop down in my jsp page.
Note: My jsp page loads through json response.
I have a select box inside a form. But i don't t know how to populate it when my jsp page loads.
And in the same page i have a select dropdown in my Struts2 jquery grid,which i am able to populage but i don't know how to populate a drop down for my form which are out side of the grid.
Please help me regarding this issue.
my jsp page
<s:url id="selecturl" action="selectaction"/>
<s:url id="bookediturl" action="bookeditt"/>
<s:url id="bookremoteurl" action="booksetups"/>
<sjg:grid
id="bookgrid"
formIds="form2"
reloadTopics="reloadMyGrid"
caption="List of Cover Details"
dataType="json"
href="%{bookremoteurl}"
pager="true"
gridModel="gridModel"
rowList="50,100,5000"
rowNum="20"
filter="true"
filterOptions="{stringResult :false,searchOnEnter : false,enableClear : true,gridModel : true}"
rownumbers="true"
editurl="%{bookediturl}"
navigator="true"
editinline="true"
navigatorSearch="false"
autowidth="false"
width= "1550"
viewrecords="true"
navigatorRefresh="true"
navigatorDelete="true">
<sjg:gridColumn name="id" index="locationId" title="ID" formatter="integer" sortable="false" key="true"
search="false" editable="true" hidden="true" />
<sjg:gridColumn name="authLastname" index="authLastname" title="AuthorLastname" sortable="true" search="true" editrules="{required: true}"
editable="true" edittype="text" />
<sjg:gridColumn name="subjectId" title="Subject Name" editable="true" sortable="false" align="center" search="false" searchtype="select"
searchoptions="{dataUrl:'%{selecturl}'}" edittype="select" editoptions="{dataUrl:'%{selecturl}'}" />
</sjg:grid>
<div id="myDivBox" style="display:none; width :300px;position: relative;top: -30px;left: 299px;button:0px;">
<s:form action="searchkeywordss" id="form2" theme="simple" cssClass="yform">
<sj:textfield placeholder="Enter keyword to search" cssClass="txtbox" size="42" maxLength="255" name="keywordsearch"/>
<sj:select href="%{selecturl}" name="countryselect" list="%{lstsub}" listKey="id" listValue="subjectName" theme="jquery" cssStyle="margin-top:4px;"/>
<sj:a button="true" id="btnid" cssStyle="position: relative;top: 0px;left: 09px;" onClickTopics="reloadMyGrid">Find</sj:a>
</s:form>
</div>
struts.xml
<action name="booksetups" class="v.esoft.actions.bookdetails.BookdetailsAction" >
<result name="success" type="json"/>
<result name="login" type="redirect"> /index.jsp </result>
</action>
<action name="selectaction" class="v.esoft.actions.bookdetails.SelectAction">
<result name="success">/select.jsp</result>
</action>
You should only use the sj:select like below
<sj:select href="%{selecturl}" name="countryselect" list="subjectList" listKey="id" listValue="subjectName" theme="jquery" cssStyle="margin-top:4px;"/>
where selecturl returns a json response, subjectList is name of list in the json reponse which contains the options
Your selectaction should have a json response, but what you have now is an action returning a jsp so it would not work. If you cannot change it, you should create another action which returns json.

How to send blog and page comment as email in Kaleo Workflow in Liferay 6.1?

I'm able to send notification about new comments, but I'd like to send the comment as part of the email. Here's what I got so far:
<notification>
<name>Notification</name>
<description>Notifies about new blog or page comments</description>
<template>
<![CDATA[
<p>
There's a new comment at page ${page_url} by ${user_name} :
<#if comment != "" >
<br /><strong>${comment}</strong>
</#if>
</p>
<p>With Love,<br /><strong>Liferay</strong></p>
]]>
</template>
<template-language>freemarker</template-language>
<notification-type>email</notification-type>
<recipients>
<role>
<role-type>regular</role-type>
<name>Portal Content Reviewer</name>
<auto-create>false</auto-create>
</role>
</recipients>
<execution-type>onEntry</execution-type>
</notification>
How would I assign the ${page_url}, ${user_name} and ${comment}?
Ok, $serviceContext has everything I needed. Note that I changed template language to velocity. For example:
<template>
<![CDATA[
## All attributes
##set ( $debug = ${serviceContext.getAttributes()} )
## URL to page:
#set ( $url = ${serviceContext.getAttribute("contentURL")} )
##Latest comment
#set ( $body = ${serviceContext.getAttribute("body")} )
<p>
There's a new comment at page $url :
<br /><strong>$body</strong>
</p>
]]>
</template>

How to extend Zend_Form prefix path while configuring form through XML (Zend_Config) to load custom form elements?

I'm loading my Zend_Form from an XML file :
<form>
<elements>
<role>
<type>MyProject_Form_Element_Select_Roles</type>
<options>
<label>Role:</label>
<value></value>
</options>
</role>
<valid>
<type>submit</type>
<options>
<label>Valid</label>
</options>
</valid>
</elements>
</form>
Of course the XML below doesn't work since Zend doesn't know how to load my custom field (which is just an extension of Zend_Form_Element_Select), but the line below doesn't work, if anyone can help :
<form>
<elementPrefixPath>
<prefix>MyProject_Form_Element_Select</prefix>
<path>MyProject/Form/Element/Select</path>
<type>element</type>
</elementPrefixPath>
...
I found these config features really cool but finding info or tutorial on them is really tough (I know there's some mapping rule between the Zend_Form objects structure and the expected config file, but I do never found a complete description of it if someone has a link)
Here's the correct form XML description :
<form>
<prefixPath>
<element>
<prefix>MyProject_Form_Element_Select</prefix>
<path>MyProject/Form/Element/Select</path>
</element>
</prefixPath>
<prefixPath>
<element>
<prefix>MyLib_Form_Element_Select</prefix>
<path>MyLib/Form/Element/Select</path>
</element>
</prefixPath>
<elements>
<role>
<type>Roles</type>
<options>
<label>Role:</label>
<value></value>
</options>
</role>
<valid>
<type>submit</type>
<options>
<mycustomoption></mycustomoption>
<label>Valid</label>
</options>
</valid>
</elements>
</form>
The custom options will be send inside the $options argument of the constructor of your Element
class MyProject_Form_Element_Select_Roles extends Zend_Form_Element_Select
{
public function __construct($spec, $options = null) {
//don't forget to call parent !
//$options is a Zend_Config that should have as a member mycustomptions
}
}