I am currently trying to send a log file with NXLog to a remote server. I have this working correctly. My next challange is that the date changes on the log file daily. For example on day one it would say log.20170110 and the day after it would say log.20170111. I would like my NXLog configuration to be able to have a date variable at the end of log. is this possible. My current configuration is below.
define ROOT C:\Program Files (x86)\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
<Extension syslog>
Module xm_syslog
</Extension>
<Input in>
Module im_file
File 'C:\Temp4\log.20170104.txt'
SavePos TRUE
</Input>
<Output out1>
Module om_tcp
Host 10.10.10.10
Port 5166
</Output>
<Route 1>
Path in => out1
</Route>
Any help would be greatly appreciated.
Thanks,
SG
You should be able to use the strftime function to generate a formatted date string. It at appears the format string you want to use is %Y%m%d.
So that would look like this
File 'C:\Temp4\log.' + strftime(now(), '%Y%m%d') + '.txt'
The following should work for that:
File 'C:\Temp4\log.*.txt'
Related
I try to create an application configuration with .env file, for the first I can get the value of variables for this config.
APPLICATION_NAME=MyApps
LOGGING__LOGLEVEL__DEFAULT=Warning
PROPERTY=value
Result :
Result 1
But, when I try to add ConnectionString variable to .env file. And running my application, the value for this variable always returns null
CONNECTIONSTRINGS__CONN=Database=master;Server=(local);Integrated Security=SSPI;
Result :
Result 2
I think the = symbol on Database=master;Server=(local) will detect as a command. Can anyone help me to explain why this happens, And how to escape the = symbol in .env file?
I have a json file that looks like this:
"redisClient": "redis://127.0.0.1:6379"
However I have recently updated my redis-server to require a password, so I need to include the password before the host. I have an environment variable which is in my .env file which looks like this
REDIS_ACCESS_KEY = SDGJKSDGSJG4124124
I would like to be able to do something along these lines:
"redisClient": "redis://:process.env.REDIS_ACCESS_KEY#127.0.0.1:6379"
But this is not working. How can I include my ACESS_KEY variable so that the end goal is that redisClient = "redis://SDGJKSDGSJG4124124127.0.0.1:6379"?
I am tring to import sql file from command prompt. where i use source command and the file path is set into one varible :
set #path='/home/xxx/Downloads/database script/adverise.sql';
source #path
And the error is
ERROR: Failed to open file '#path', error: 2
Thanks in advance
You can simply use the below command, you don't need to put the store into a variable and then use it.
source /home/xxx/Downloads/database script/adverise.sql
If you still need to store the path in a variable then store it into a variable but you can also pass the same path with "source /path/to/file" so that both scenarios will handle.
I am trying to convert and evtx log file to csv from log parser 2.2. I just want to copy all of the data into a csv.
LogParser "Select * INTO C:\Users\IBM_ADMI
N\Desktop\sample.csv FROM C:\Users\IBM_ADMIN\Desktop\Event
Logs\sample.evtx" -i:EVTX -o:csv
But I am getting the error below.
Error: Syntax Error: extra token(s) after query: 'Logs\sample.evtx'
Please assist in solving this error.
I know this has been a year but if you (or other people) still need it and for sake of reference, this is what I do:
LogParser "Select * INTO C:\Users\IBM_ADMIN\Desktop\sample.csv FROM 'C:\Users\IBM_ADMIN\Desktop\Event Logs\sample.evtx'" -i:evt -o:csv
Correct input type is evt, not evtx.
If there is space in the Event Logs folder, enclose with single quote.
The Problem was due to the extra space in between the folder name Event Logs. Changed the folder name to a single workd and it worked.
you have to convert .evtx file to .csv than you can read from this .csv file.
like this .enter image description here
//String command = "powershell.exe your command";
//called the PowerShell from java code
String command = "powershell.exe Get-WinEvent -Path C:\windows\System32\winevt\Logs\System.evtx | Export-Csv system.csv";
File seys = new File("system.csv");
Process powerShellProcess = Runtime.getRuntime().exec(command);
Requirement: Run the below XMLA script on a particular node of SQL server 2012 and store the output data in a file or an SQL table
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_METADATA</RequestType>
<Restrictions>
<RestrictionList>
<ObjectExpansion>ExpandObject</ObjectExpansion>
</RestrictionList>
</Restrictions>
<Properties>
<PropertyList>
</PropertyList>
</Properties>
I'm not finding any component in SSIS that could run the XMLA script and store the results. let me know is it possible in any other ways.
Like #sebTHU said you could use a SSAS DMV:
Select [CUBE_NAME], LAST_DATA_UPDATE from $system.MDSCHEMA_CUBES
However, if you want to list all the databases and their last processed date, install ASSP and then run this:
CALL ASSP.DiscoverXmlMetadataFull("\Databases\Database", "" ,"<ObjectExpansion>ExpandObject</ObjectExpansion>")
You could use a linked server or a .NET source component in SSIS.